Swap HTML elements using CSS?
February 17, 2008 8:42 AM
Subscribe
How do I swap the order of two HTML elements using CSS?
I'm creating an iPhone specific style of my local newspapers website. I can not alter their HTML code, but their code places the
main story third in the order of information, and the "
todays news" links
second. I would like to swap the two using CSS. Oversimplified example:
<p id="first">First Paragraph in code</p>
<p id="second">Second paragraph in code</p>
would appear in the browser as:
Second paragraph in code
First Paragraph in code
The two "paragraphs" will never be a fixed dimension, so I need them to flow as if they were positioned in the HTML with
Second coming before
First.
Any ideas? I've tried absolute, fixed positioning and floats, but none seem to work just right.
posted by idzyn to computers & internet (8 comments total)
2 users marked this as a favorite
posted by kindall at 8:58 AM on February 17