Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 7
Trades: 0
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
 
 
Register now for full access!
Old 05-12-2008, 09:56 AM Re: DIV Tag Help: Complete Beginner!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

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
Trades: 0
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!
Defies a Status

Posts: 2,071
Name: carl
Location: UK
Trades: 0
I think adding this will do the trick

padding-top: 0;

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

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

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
Trades: 0
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!
Defies a Status

Posts: 2,071
Name: carl
Location: UK
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

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
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

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





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



Page generated in 0.39027 seconds with 12 queries