css - Setting a fixed whitespace for text -


i'm new css, apologise if question bit simple.

i have nav-bar sits in centre of page , has width of 'x'

what want create white space <p> text, if drew 2 vertical lines; touch ends of nav bar, text touches the vertical lines - regardless of window size.

my current solution makes text move relative window size, whereas want text align nav bar on vertical axis whilst being justified.

here's picture of want make clearer:

png

here's current solution works if window size right:

html:

<p id="body"> blah blah ..... </p> 

css:

#body {    margin: 25px 310px 25px 310px;    text-align: justify;    line-height: 30px; } 

give same width 'p' , center margin it, nav bar.

html

<div id='navbar'></div <p id="body"> blah blah ..... </p> 

css

#navbar, p {    width: 900px;    margin: 10px auto; }  p {     text-align: justify;     line-height: 30px; } 

noe both 'navbar' , 'p' align vertically need them.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -