2

Is there a way to create an html element that doesn't move even if the content on the webpage changes it stays in the same position and the rest of the content wraps around it?

I want to create a long line that stretches across a dynamic webpage. When someone adds more content to the webpage, that line should stay intact and not move like a brick wall and the rest of the content maneuvers around it or jumps over it.

Visual example:

content content content content content contentcontent content
content content content content content contentcontent content co
--------------------------------------------------------------------(long line)
ntent content contentcontent contentcontent contentcontent content
content contentcontent contentcontent contentcontent contentcontent 

Notice how on the 2nd line the text wraps over the long line to continue after the line.

Hope it makes sense,

Found this question, this is more or less exactly what I want jQuery Split content based on height

The questioned wasn't answered though.

Community
  • 1
  • 1

2 Answers2

3
.fencepost {float: left; width: 0.1px; height: 100px;}
.gate {float: left; clear: left; width: 99.9%; height: 30px;}

http://jsfiddle.net/isherwood/P6Z3p/

isherwood
  • 58,414
  • 16
  • 114
  • 157
0

I don't think its possible with CSS. You'd probably have a set character limit per 'page' and when you detect on a page that the character limit is over using javascript, you would force the user's focus onto a new 'page'.

The styling of the line is then irrelevant - its just a normal HTML element width 100% or something, the important bit is forcing the split on the user

TimCodes.NET
  • 4,601
  • 1
  • 25
  • 36