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:
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
Post a Comment