Jump to content

"No Table" problems


BalconyShore

Recommended Posts

I've started learning html a month ago, so I'm pretty new with techie jargon. Anyway, I've just started learning about CSS, and came across a section in the CSS - Classification page. There's a section on creating a web page without any tables. I tried looking up on how to center the "no table" (is it called a container?). I haven't been able to find what I was looking for. Can somebody help me?

Link to comment
Share on other sites

The div tags that make up the layout are generally referred to as layers or by their id which is usually something like 'container' or 'content'. The following code will center the whole page where 'someid' is the id of the outermost div.

#someid {     position: relative;     margin: 0 auto;}

Link to comment
Share on other sites

Thank you for clearing up some of my confusion. Layers seems to make more sense to me :) . Though I did try to incorporate the code with some testing code, and I still wasn't able to get it to center. Could you please tell me what I did wrong? <html><head><style type="text/css">#someid { position: relative; margin: 0 auto;}#top { background-color: #ccc; padding: .5em; position:relative; margin:0; width:90%} .intro { color: red; font-weight: bold; }</style></head><body><div id="someid"><p>Center<p></div><div id="top"> <h1>Chocolate curry</h1> <p class="intro">This is my recipe for making curry purely with chocolate</p> <p class="intro">Mmm mm mmmmm</p> </div></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...