I have dynamic HTML generated based on user entered content. I want to show that HTML as A4 pages. The content may span to any number of pages as it is continous.
A code pen like this one https://codepen.io/rafaelcastrocouto/pen/LFAes helps how to show html as A4 pages. This is quite good but my problem is that I don't know in advance how much content one page can have. Will the content be rendered in first page tag or two page tags or more, I don't know since this is user generated content.
<page size="A4">
<!-----Dynamic HTML comes here, can confine to this page or overflow out of that---->
</page>
How do I show html structured into multiple pages in this scenario?
I know a hint that it might be possible with use of Javascript or query to create multiple page tags and place html chunks inside that but I would prefer CSS way of doing it as JS mechanism is susceptible to inaccuracies due to calculation of heights.
Is that possible?
Also how about using page-break-before and page-break-after property of CSS. I have used that property but that renders only in PDF, I want to show that in HTML in browser, is that possible with that?
Related
I have a html document loaded in an iframe on a website.
The document has a table of contents and clicking on any of the links jumps to the appropriate part of the document.
Navigation is supposed to work from a sidebar that is specified by a separate XML.
Adding a link to said XML displays the HTML in the iframe:
href="source_folder/file.html"
Issue is, when I try to add a link to a specific section, like href="source_folder/file.html#_Toc0123" it just jumps back to the top of the HTML.
In the usual use-case, the sections are all separate HTML files, and get linked in the corresponding XML. Issue being I don't want to go through the hassle of separating multiple large files into individual HTMLs.
Any idea on what I'm missing? Or is this simply not possible?
(I didn't build the original site, but if there is an attribute that governs it, feel free to let me know where to look for it)
Thanks!
I have a website that I update some of it's content on monthly basis.
The content for those pages include tables in iframe format. Now when I search for that particular keyword i see that google is indexing my iframes individually.
Therefore their contents doesn't add any value to the main parent container.Below you'll see one the pages with iframe.
http://www.reguluspc.com/parts/case.html
I want to keep the content intact but keep the table in iframe and update the table only. To avoid duplicated content, I keep the iframe but it doesn't look good as it doesn't have any navigation or proper CSS file.
Any ideas how to make the iframe content to be indexed as part of the main parent page?
Cheers.
As these are two separate urls, they will be indexed as separate content.
Why are the tables being loaded from iframes? Do you have any server-side languages like PHP, JAVA, .NET, etc? Your might also have *.shtml which would allow you to do server side includes for content like that.
I want to add twitter card meta tags to my website. i cannot add static tags since the content attribute in the meta tag has to change dynamically.
Plz help if someone has a solution.
You can't, at least not in any way that Twitter is going to recognise.
When Twitter fetches the page, it is always going to get the meta elements that are in the HTML, never ones added with client side JavaScript.
If you are changing content dynamically then make use of the history API to update the URI, and make sure that the server will generate all the content for each URI when the URI is used as an entry point (you can still use JavaScript to generate the content when moving from another page on the site).
You can generate pages dynamically (server side) as long as you don't intend to change them after. Think about the process in the same way you would build landing pages for SEO purposes. Twitterbot is in many ways really similar to Googlebot and similar indexers.
See https://dev.twitter.com/blog/twitter-cards-tips-tricks for a few examples of sites doing this.
I would like to display the content of a HTML file,in the form of book with many pages(not side by side pages, but one after the other, like PDF), when opened in some browser. Say, i define page width=600px and height=800pz, the content should fit into one page and the remaining should overflow to next page and like that. And it should work for any HTML file.
How can i break the content into pages ? In any way XSL helps me to achieve it ?
This should be theoretically possible by putting the document into an iframe that is 800 pixels high, and changing the scroll position inside that iframe (Page 1 = 0px; Page 2 = 800px; Page 3 = 1600px ....)
The HTML page in question would have to be on your domain, though.
There is no proper way to actually display those pages side by side, though. You'd have to clone the whole document for as many times as there are pages, and display as many iframe s with the page scrolled to different positions.
Depending on what you want to do, it might be better to use a different technology for this (e.g. having a browser print out a web page to a PDF file, splitting the content into pages in the process.)
If you want PDF style functionality, convert the html on the fly into a pdf and then embed it in the page. You can specify the width and other params when you are generating the pdf.
This is what I would like to do. I would like to load content dynamically.
Everything except the actual content will be rendered by javascript. I will place all the required information in a javascript variable or array at the bottom of the page. Then I will use javascript to place the content in the designated area.
These are the types of things I would like javascript to render:
Login menu
Header and logo info
Side bar info
Footer info
Dialog popups
Ads
All of the MEAT content will not be rendered by javascript. I will use the backend server to put the content in html. My logic is that more of the real content will be in HTML and all the other things will be rendered by javascript. Will this help or hurt SEO?
Yes this will hurt SEO. You want to have all your links/menus/navigation to be accessible by the SEO bots otherwise your site will not be indexed properly. What exactly is it you're trying to accomplish here? I'm sure there are plenty of ways to accomplish what you're trying to do without hurting SEO.