home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Couple of simple DIV layout questions

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1508
Discussions: 200,952, Posts: 2,379,480, Members: 246,318
Old April 16th, 2007, 10:43 AM   Digg it!   #1 (permalink)
Member
 
Join Date: Jun 2004
Posts: 178
Couple of simple DIV layout questions

Hi

1. If you have a DIV within a DIV, and you want the nested one to be 20px smaller (left and right) than the outside DIV, how do you do that? I thought it would be either padding or margin settings, but when I use them, the left setting is fine (20px inside the outside DIV), but the right setting seems to be taken from the right hand side of the screen instead of the outer DIV. Is there a setting for the outer DIV I need to set too?

2. I have two DIVs, and I want them on top of one another as in a content/footer relationship. They are set up basically like <div id="content"></div> <div id="footer"></div>, but the footer always appears within the content, not outside it. How do I rectify this?

Cheers

Shaun
__________________
I'm looking for a male vocalist to work with. Go to http://people.aapt.net.au/celebritymusic/s...ikingsmith.html to email me
celebritymusic is offline   Reply With Quote
Old April 17th, 2007, 11:04 AM     #2 (permalink)
Super F@D Folder
 
Join Date: Jun 2004
Posts: 5,083
Send a message via AIM to sr71000
Hey. Here's how to center one div inside another! :-D set the widths to whatever you want them, then the inner div set margin-left:auto; margin-right:auto;

Code:
<html>
<head>
</head>
<body>
<div style="width:800px; height:110px; background-color:black;">
<div style="width:760px; height:100px; background-color:green; margin-left:auto; margin-right:auto;">
</div>
</div>
</body>
</html>
sr71000 is offline   Reply With Quote
Old April 17th, 2007, 11:05 AM     #3 (permalink)
Super F@D Folder
 
Join Date: Jun 2004
Posts: 5,083
Send a message via AIM to sr71000
on the div you want to appear below the content add
Code:
style="clear:both;"
sr71000 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you get CSS DIV layout to look correct cross browser? celebritymusic Webmastering and Programming 4 April 4th, 2007 11:29 PM
How to make a DIV rest at the bottom of another DIV in CSS? celebritymusic Webmastering and Programming 1 March 1st, 2007 10:15 AM
Couple Questions PwnJabi General Tech Discussion 4 November 3rd, 2006 04:45 PM
Simple layout how does it look? Vision_XD Webmastering and Programming 17 July 18th, 2005 02:21 AM
Couple questions.. ILC PC Modification 12 January 9th, 2002 05:11 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2943)
The disrespect of Obama by Russian .. (41)
Making Health Care Worse (178)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
windows 7 problem (7)
Regular Build (11)
Is the PSU I received dead? (12)
radeon x850xt platinum & shader.. (6)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (10)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Recent Discussions
SELLING FRESH,CVV,LOGINS,DUMPS,TRACKS.. (0)
CPU fan stops spinning randomly (9)
Common Spyware Solutions (105)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Modern Warfare 2: Who Bought It? (63)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Laptop with wireless problem. (3)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
windows vista security holes (10)
Point and Shoot Camera Suggestions. (4)
Multiple Restarts Required at Boot (2)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Hp Artist Edition + Matching Bag (0)
Asus P4G8X Mobo (6)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)


All times are GMT -4. The time now is 04:07 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28