PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > macromedia.dyna.html > CSS float/margin and padding problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
CSS float/margin and padding problem

Réponse
 
LinkBack Outils de la discussion
Vieux 03/10/2008, 09h40   #1
nowherecreative
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut CSS float/margin and padding problem

I'm fairly new to CSS and I am doing a site redesign for the company I work
for. Here is the link to the page I'm working on, you should be able to see the
issue I'm having: http://www.colonybeachresort.com/red...test_page.html

I'm trying to get the main content area and the side bar area (the dark blue
and the light yellow boxes with placeholder text) to have some sort of padding
around the edges so the type doesn't flow all the way to the top, sides, and
bottom. Every time I add margin or padding to these areas it makes the right
float (yellow box) go below the main content (blue box). I don't know what I'm
doing wrong, so any is very appreciated!!! I've also attached the CSS
code, I hope it s! It is the #body-main and #sub-nav we're paying attention
to.

The blocks of color are only for guides at this time (that is why it looks so
ugly) I don't want to put the graphics in until I have the CSS set up just
right.

html, body {
margin: 0;
padding: 0;
}
html {
overflow-x: hidden;
overflow-y: scroll;
}
#page-container {
width: 900px;
margin: auto;
}
#top-nav {
height: 25px;
background-color:#FF99FF;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #3399CC;
letter-spacing: 1px;
}
#logo-container {
height: 100px;
background-color:#CCCCFF;
}
#main-nav {
height: 75px;
background-color:#99CCCC;
}
#flash-container {
height: 300px;
background-color:#CCCC99;
}
#booking-mask {
clear: both;
height: 50px;
background-color:#33CCFF;
}
#body-main {
float: left;
width: 600px;
background-color:#333399;
font-family: Geneva, Arial, Helvetica, sans-serif;
line-height: 22px;
font-size: 12px;
color: #FFFFFF;
letter-spacing: 1px;
clear: both;
}
#sub-nav {
float: right;
width: 300px;
background-color:#FFFF99;
clear: none;
}
#footer {
clear:both;
height: 100px;
background-color:#993399;
}

  Réponse avec citation
Vieux 08/10/2008, 09h17   #2
Rock Artist
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CSS float/margin and padding problem

I'm pretty new to CSS too, and I'm not sure this is going to , but I think
I had a similar problem, only mine was with an image floated to the left with a
left margin. After doing a browser compatibility check, I found this out.....

"Line 112, Double Float Margin Bug 'error'
When a margin is applied to a floated box on the same side as the direction of
the float, the margin is doubled. This bug only affects the first float in a
row of one or more floats.
Affects: Internet Explorer 6.0 Likelihood: Very Likely"
This was the solution: Specify display: inline; for the affected float.

this was the code of my image before I changed it:

.image {
background-color: #121922;
height: 100px;
width: 100px;
float: left;
margin: 20px;

Someone told me to just add "display:inline" to the styling like this: (and it
worked)

.image {
background-color: #121922;
height: 100px;
width: 100px;
float: left;
margin: 20px;
display: inline;
}

Hope this s!

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h55.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18469 seconds with 10 queries