|
|
#1 |
|
Baseband Member
Join Date: Nov 2011
Posts: 28
|
Suppose I've placed two paragraphs, a few headers between the <CENTER> tags...
Now I want to color only the central position of my page such that the entire document appears to be inside a colored block... Can you pls help...? Maybe something like this: <Center> <p> bla bla </p> <h2> bla bla...</h2> etc etc... . . . . </center> |
|
|
|
|
|
#2 |
|
Beta Member
Join Date: Jan 2012
Location: USA
Posts: 4
|
<Center>
<p> bla bla </p> <h2> bla bla...</h2> etc etc... . . . . </center> Create a div inside the center tag <center> <div style="background-color:#fffff"> <p>blabla</p> <h2>blabla</h2> etc... </div> </center> For the color code you can use any color picker. There's also an extension for chrome, eyedropper. |
|
|
|
|
|
#3 |
|
Fully Optimized
|
Better yet, you can use DIVs and CSS to style the block. No more need for the <center> tag at all!
HTML -- <div class="anynameyouwanthere"> <!-- enter your content here --> </div> CSS -- .anynameyouwanthere { width: 500px; /* You can set it to whatever width you need */ margin: 0 auto; /* This is what centers the element! */ background: #fff; /* Set the background color */ color: #000; /* If needed, set the color of the font */ } Thanks!
__________________
HingeWeb.com - We provide affordable and top of the line web development, web design, and search engine optimization. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|