Reply
DIV Tag Help: Complete Beginner!
Old 05-12-2008, 06:18 AM DIV Tag Help: Complete Beginner!
Novice Talker

Posts: 7
Hello,

I am just learning DIV Tags and I want to create a outline of a site using DIV tags, something like salesforce.com, how it is centered, positioned at the very top, about 900pixels, etc. However, I am not sure if I am doing it right AND I cannot figure out how to center the entire DIV Tag. So if anyone can provide some help to a complete beginner, it would be appreciated. Thank You.

Here is what I have so far in regards to a CSS file:

Code:
.main {
}
.main {
    background-color: #FFFFFF;
    vertical-align: top;
    height: 600px;
    width: 900px;
    margin-top: 0;
    margin-bottom: 0;
    overflow: auto;
    top: -19px;
    position: absolute;
    padding: 0;
    text-align: left;
    background-position: center;
    margin-right: 0;
    left: -29px;
}
I am also having problems with writing text in the box. =P Any ideas?
Wingit1 Global is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-12-2008, 09:56 AM Re: DIV Tag Help: Complete Beginner!
chrishirst's Avatar
Super Moderator

Posts: 15,326
Location: Blackpool. UK
Code:
.main {
    background-color: #FFFFFF;
    vertical-align: top;
    height: 600px;
    width: 900px;
    margin-top: 0;
    margin-bottom: 0;
    overflow: auto;
    top: -19px;
    position: absolute;
    padding: 0;
    text-align: left;
    background-position: center;
    margin-right: 0;
    left: -29px;
    margin:0 auto;
}
And use a full doctype.

<added>
http://www.webmaster-talk.com/css-fo...r-website.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System | Bits & Bobs

Last edited by chrishirst : 05-12-2008 at 09:58 AM.
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-13-2008, 12:32 AM Re: DIV Tag Help: Complete Beginner!
Novice Talker

Posts: 7
Thank You. Although, the only property I am missing is the one that will make the DIV tag position to the very top of the page, kinda like how the jet black image that is on the very top of this webmaster-talk forum, how there is no space in between that, I want that of that for the DIV tag, so which property do I need to place inside that will do this? Thank You!
Wingit1 Global is offline
Reply With Quote
View Public Profile
 
Old 05-13-2008, 12:52 AM Re: DIV Tag Help: Complete Beginner!
bakerc's Avatar
Penguins on toast

Posts: 1,875
Name: carl
Location: UK
I think adding this will do the trick

padding-top: 0;

( you have already zero'd the margin top and bottom)

Last edited by bakerc : 05-13-2008 at 12:54 AM.
bakerc is offline
Reply With Quote
View Public Profile Visit bakerc's homepage!
 
Old 05-13-2008, 12:59 AM Re: DIV Tag Help: Complete Beginner!
Novice Talker

Posts: 7
That doesn't work. This is the CSS coding that I have already. I am trying to recreate a site like salesforce.com (good practice I might add) and I can't seem to get the DIV tag to stick to the very top. If I put an absolute type in that would do it, but is that the proper way? What is the proper way to do it?

Current Coding
Code:
.main {
    background-color: #FFFFFF;
    width: 900px;
    padding: 0;
    text-align: left;
    background-position: center;
    margin:0 auto;
    padding-top: 0;    
}
Wingit1 Global is offline
Reply With Quote
View Public Profile
 
Old 05-13-2008, 01:03 AM Re: DIV Tag Help: Complete Beginner!
bakerc's Avatar
Penguins on toast

Posts: 1,875
Name: carl
Location: UK
have you zero'd everything else , like your <body> element, you should zero everything initialy so the browsers dont use their default.

body {
margin: 0;
padding: 0;
}

Sorry I didn't notice in your previous post that you have already set the padding to 0 in the code you posted above (I am tired and didn't read it properly!)...you can remove

padding-top: 0;

as you have already set

padding: 0;

which zero's the padding top, bottom, left and right.

Last edited by bakerc : 05-13-2008 at 01:14 AM.
bakerc is offline
Reply With Quote
View Public Profile Visit bakerc's homepage!
 
Old 05-13-2008, 01:23 AM Re: DIV Tag Help: Complete Beginner!
Novice Talker

Posts: 7
aww....that was my problem..... it is now fixed. Thank you so much. =D
Wingit1 Global is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to DIV Tag Help: Complete Beginner!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13604 seconds with 12 queries