TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-03-2008, 07:14 PM   #1 (permalink)
The Gregarious
Upcoming Programmer Inquisitive 
 
Join Date: Sep 2007
Posts: 680
Thanks: 85
Tanax is on a distinguished road
Default How to code this?

How do I code this in a nice way with CSS??

I want the (1) to expand as a fluid with the website.. so it's at the website borders all the time(maxwidth of screen).

I want the (2) to be centered, and floating ABOVE(topology) the (1).

And lastly I want the (3) to be BELOW(screen-wise) the (2) but ABOVE(topology) the (1).

Look at the image for a description!
Thanks in advance!
Attached Thumbnails
how-code-final_large.jpg  
__________________
Tanax is offline  
Reply With Quote
Old 05-03-2008, 11:09 PM   #2 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 368
Thanks: 44
Aaron is on a distinguished road
Default

1: width:100%;
2: margin-left:auto; margin-right:auto; overflow:visible;
3: position:relative;

I don't quite understand what you want, the image looks like what you want, but :/ This CSS should work.
__________________

I feel better hating IE.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 05-06-2008, 08:42 PM   #3 (permalink)
The Frequenter
Advanced Programmer Top Contributor Good Samaritan 
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 469
Thanks: 26
sketchMedia is on a distinguished road
Default

shorthand margin values:
margin:0 auto;
same as:
margin: 0 auto 0 auto;
or
margin-top:0;
margin-right: auto;
margin-bottom:0;
margin-left:auto;
__________________
sketchMedia is offline  
Reply With Quote
Old 05-07-2008, 01:35 AM   #4 (permalink)
The Frequenter
 
Join Date: Dec 2007
Location: In my basement
Posts: 368
Thanks: 44
Aaron is on a distinguished road
Default

Yeah, except that sets all the margins to 0, including the top and bottom margins, which could possibly not be what he wants. And that last one isn't even shorthand.

Anyway, I don't know why I put overflow visible on there.


Coding the entire thing... Slice the entire background on the very left.

body(background:#hexColorOfTheTopOfTheImage url('image.gif') repeat-x 0pt 100% scroll;}

as for the bottom part, it really depends. Pushing a footer is a pain, you can normally set a <div> with height:100%; above it, and then place the footer below.

Finally, for the main content, pick out your favorite rounded corners technique and add a wrapper around it with margin:0 auto; or text-align:center;
__________________

I feel better hating IE.
Send a message via MSN to Aaron
Aaron is offline  
Reply With Quote
Old 05-07-2008, 12:07 PM   #5 (permalink)
The Frequenter
Advanced Programmer Top Contributor Good Samaritan 
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 469
Thanks: 26
sketchMedia is on a distinguished road
Default

Quote:
And that last one isn't even shorthand.
I put that at the end to show the long equivalent, also it doesn't set all margins to 0; 'margin 0 auto;' sets top and bottom to 0 and left auto (and possibly right auto i cant remember if it does or not)

If you want a different margin top/bottom this does the trick and should still be centred:

margin: <top value> auto <bottom value>;
__________________
sketchMedia is offline  
Reply With Quote
Old 05-07-2008, 03:01 PM   #6 (permalink)
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

margin: 0 auto is the short hand for setting all of them, you're right.

The equivs

margin: 0; - top/right/bottom/left
margin: 0 0 0 0;

margin: 0 auto; - top/bottom right/left
margin: 0 auto 0 auto;

margin: 0 auto 2px; top right/left bottom
margin: 0 auto 2px auto;
delayedinsanity is offline  
Reply With Quote
Old 05-30-2008, 12:21 PM   #7 (permalink)
The Wanderer
 
Join Date: Mar 2008
Location: United Kingdom
Posts: 22
Thanks: 1
boycoda is on a distinguished road
Default

<div class="1">
<div class="2">
</div>
<div class="3">
</div>
</div>

.1 { width: 100%; }
.2 { margin: 0 auto; background: url(images/yourimage.gif) no-repeat; width: 500px; }
.3 { margin-top: 10px; font-size: 12px; text-align: center; }

follow and modify.
Send a message via MSN to boycoda Send a message via Skype™ to boycoda
boycoda is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 11:29 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0