Need help with some coding - HTML/CSS

Soumikbhat

Baseband Member
Messages
29
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>
 
<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.
 
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!
 
Back
Top Bottom