The Straight Dope

Go Back   Straight Dope Message Board > Main > Mundane Pointless Stuff I Must Share (MPSIMS)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2012, 01:19 AM
Leaper Leaper is offline
Charter Member
 
Join Date: Jul 2001
Location: In my own little world...
Posts: 8,112
Gaaaahh! Dreamweaver help, anyone?

I'm using Dreamweaver. Starting from their standard 2 column with header and footer "template" (I removed the footer and its associated stuff from the CSS file), I put in two images, stacked atop each other. But there are ugly padding gaps between the top of the page and the top image, and between the two images.

I've searched and searched for ways to remove that padding, but nothing I put into, or remove from, the CSS works. I've found similar questions in Google searches, but either the thread ends with no resolution or the suggestion just doesn't work! I'm getting really frustrated. Can anyone suggest anything?
Reply With Quote
Advertisements  
  #2  
Old 05-16-2012, 05:16 AM
GuanoLad GuanoLad is offline
Charter Member
 
Join Date: Sep 1999
Location: Where the wild roses grow
Posts: 18,126
Have you tried putting this at the very top of the CSS?

Code:
* {
	padding: 0;
	margin: 0;
}
It resets all paddings in everything to zero, letting you then go in to specify the defaults you want one by one as you need them.
Reply With Quote
  #3  
Old 05-16-2012, 02:29 PM
Leaper Leaper is offline
Charter Member
 
Join Date: Jul 2001
Location: In my own little world...
Posts: 8,112
Oh, thank fucking God. It was a nightmare trying to Google search this, but I should've known to try here first! Many praises to you, boy of poop, for your help!

(BTW, I do have another, much more minor question, if you don't mind: I want to make a CSS rule that automatically puts padding between sidebar elements - usually graphics. But all the "margin" and "padding" changes I make change margins/padding for the entire set of contents, not between individual elements of those contents. How do I do that?)
Reply With Quote
  #4  
Old 05-16-2012, 03:17 PM
moi moi is offline
Guest
 
Join Date: Feb 2001
Leaper, you would need for each of those elements to have a class or something else in common. If, for example, it was all images inside a DIV with the ID of "SIDEBAR," you could try this:

#SIDEBAR IMG {padding:5px;} (to give all images a padding of 5px all around)
#SIDEBAR IMG {padding:5px 0;} (to give all images a padding of 5px at the top and bottom, no extra padding to the left and right)
Reply With Quote
  #5  
Old 05-16-2012, 07:15 PM
GuanoLad GuanoLad is offline
Charter Member
 
Join Date: Sep 1999
Location: Where the wild roses grow
Posts: 18,126
There are risks when you reset things like this, though. It might make your List elements go all screwy, for example.
Reply With Quote
  #6  
Old 05-16-2012, 11:28 PM
ZipperJJ ZipperJJ is online now
Charter Member
 
Join Date: Aug 2001
Location: Northeast Ohio
Posts: 16,525
Quote:
Originally Posted by GuanoLad View Post
There are risks when you reset things like this, though. It might make your List elements go all screwy, for example.
Not might...it will
Reply With Quote
  #7  
Old 05-16-2012, 11:39 PM
Leaper Leaper is offline
Charter Member
 
Join Date: Jul 2001
Location: In my own little world...
Posts: 8,112
Well, I don't have any List elements right now, so I don't mind, and it doesn't seem to be messing up anything else, so that's all that matters to me right now.

Still, if I ever do have to worry about it in the future, what would you suggest doing "instead"? Just for future reference.
Reply With Quote
  #8  
Old 05-17-2012, 01:15 AM
GuanoLad GuanoLad is offline
Charter Member
 
Join Date: Sep 1999
Location: Where the wild roses grow
Posts: 18,126
Just be prepared that some things will go all wackadoo from what you're used to, and you will have to set the padding and margins for each element separately as it happens. If you make enough webpages you start to recognise the issues and how to fix them pretty quickly.

The problem with Lists is that they're made up of a complicated arrangement of padding and margins to make the indenting and bullets work, so to get them looking right again is a lot of cocking about. But there are pretty good resources out there to help before you go completely insane.
Reply With Quote
  #9  
Old 05-17-2012, 08:53 AM
ZipperJJ ZipperJJ is online now
Charter Member
 
Join Date: Aug 2001
Location: Northeast Ohio
Posts: 16,525
Yep, what he said.
Reply With Quote
Reply

Bookmarks

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:14 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.