Jump to content

Recommended Posts

Can someone help me with this div:

.fb {
color: #333;
width: 600px;
padding: 5px;
background-color: #f7f7f7;
border: 1px solid #b7b7b7;
}

 

That div is main div, but it is not centered, can someone tell me what should i add to make it on center?

btw in attachment is compressed template..

Thanks.

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/228436-help-center-div/
Share on other sites

I would use an ID for that div really instead of a class. anyways this is what you can do

 

div#my-centered-div{
     margin:0 auto;
     width:960px; /*just some width */
}

 

for IE6 and lower use

div#my-centered-div{
     text-align:center;
}

 

Hope this helps

Link to comment
https://forums.phpfreaks.com/topic/228436-help-center-div/#findComment-1177910
Share on other sites

And before <div id="fb"> to put <div id="my-centered-div"> ?

no read that last sentence, i have a lot of difficulty deciphering that.

 

Anyways, since i have no clue what your last question is.

Most websites have a markup like this and what they do is center the wrapper div.

So in other words They wrap up all they want in 1 div (in this case named wrapper) and apply the margin:0 auto; to it.

 

<body>
     <div id=wrapper>
            <div id=header></div>
            <div id=left></div>
            <div id=mid></div>
            <div id=right></div>
            <div id=footer></div>
      </div>
</body>

 

if you have questions let me know

Link to comment
https://forums.phpfreaks.com/topic/228436-help-center-div/#findComment-1177993
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.