IE7 is indenting text when it shouldn't be - css

Moved the link because it no longer points to the site, and solution has been found
I have some list elements that have a mysterious left padding/margin.
In Firefox, it displays as expected. But in IE7, there is a text indent or something forcing the inner text in about 4 spaces. See the example link above.
I have set padding to 0, margin to 0 (though it shouldn't be this as clearly the border goes around the element containing the gap), text-indent to 0, and text-align: left.
Does anyone know what may be causing this?

In your style.css file you set the LIST-STYLE-POSITION to inside. This is causing your issue in IE.
#content-body UL {
LIST-STYLE-POSITION: inside; LIST-STYLE-TYPE: disc
}
You can either remove that element, or you can add a style to your .events UL
.events UL {
...
LIST-STYLE-POSITION: outside! important;
}

Related

Nav Bar has added padding which is not in my CSS code

in the "ul" Elememt it shows that it has padding on the left side (padding is green and the orange is margin
but when I looked through what I've got in my CSS structure i do not not have any padding at all
My Nav Bar elements
I tried to fix it by checking through the dev tools but nothing happened and then I tried removing some properties in my CSS but it didn't make any changes
The user agent stylesheet of the browser itself is applying that padding. If you want to get rid of it, you'll need to override it by setting:
ul {
/* All your other ul styling here... */
padding-left: 0;
}

Strange CSS behaviour, cannot see what is taking the space up

My website header is where I have my menu. Except I am having to put a negative margin on it and I don't want to do that, but for some reason, there is something taking up space between the hgroup and the nav element. I thought it might be the form element for the search box, but when I do display:block it makes no difference. The site is here.
Another strange thing is when I hover over a submenu (e.g. recycle) the parent element goes white. I can't for the life of me work out why. See below for strange hover behaviour.
Make your body background longer?
The design changed right after I refreshed your website. As for now, all I see is that the navigation is still 1px off the header. Maybe if you'd reduce the margin-top from 42px to 41px, that problem will be solved.
EDIT:
So in Chrome, there's this 1px issue, but in Firefox, it looks fine.
The same 1px offset in Safari and Opera. But again, in IE8, it looks fine.
I think this problem has occurred due to the defined height for hgroup, if you have done that.
[ the first image is a screenshot from Chrome, the second is from Firefox ]
EDIT 2:
The offset is due to the fixed height of the background image. Other than that, everything is working just fine. Obviously, there are variations in both the images, as you can see, the chrome having the 1px offset while it is absent in Firefox. I, personally don't like to give a defined height to elements that is likely to have results like above.
One good solution would be to make a header container with 100% width and the given background image, while all the header content will go within the container. That way, no matter how high the contents within the container are, the background will remain the way it is meant to, and your navigation will not get an offset.
Yea h2 description is taking space from your header and about your menu, try splitting your rules in mainnav.css, seems like you have :hover grouped with actives, that's why your classes are messing up
This is the rule causing the problem in your css
#access #menu-menu li.current_page_item a, #access #menu-menu li.current_page_item, #access #menu-menu li.current_page_item a:hover, #access #menu-menu li.current_page_item:hover {
background-color: #FAFAF0;
box-shadow: none;
color: #0F0D0C;
<h2 id="site-description"></h2>
If you use Firebug/Inspect element, you'll see it there, just after your h1, taking up a lot of space.
#site-description {
color: #7A7A7A;
font-size: 14px;
margin: 0 270px 3.65625em 0;
}
For the White hover in the nav, make the following change:
#access ul ul {
background-color:red;
}

Is a bulleted list item always indented exactly 1.8em?

I made a css-only dropdown menu. The requirement was to have a horizontal bar of items that can each drop down a vertical menu. Furthermore, those items should not drop a tertiary menu, but instead just show bulleted lists. My html has three nested ul and the menu is working perfectly in all modern browsers. It looks like this:
However, I did not like how the darker box behind the link is starting right of the bullet and does not stretch over the whole menu width, so I played around a bit and finally came to this tweak:
#nav li ul li ul li a {
padding-left:1.8em;
margin-left:-1.8em;
}
Now the bulleted menu item looks just like I wanted:
And due to the nature of em beeing relative to the font size, it works independently of the font size, like shown with a larger font size here:
I tested this on Internet Explorer 8+9+10(developer preview), Firefox 3+7, latest Chrome, Opera and Safari and it works like a charm.
However, I just dont understand why it is exactly 1.8em that does the job. How come every browser indents the bullet items exactly this far? I searched the internet on this topic, but I did not find anything helpful. Can I be sure this works on future browsers? Are those 1.8em specified in the HTML standard?
Thanks in advance for any hint!
Edit:
To DisgruntledGoat's answer: It would not work if I used 1em/-1em or 20px/-20px. With this style:
#nav li ul li ul li a {
padding-left:20px;
margin-left:-20px;
}
I get this (obviously not scaling with the font size) result for different font sizes:
Similarly, 1em/-1em is also off and looks like on the right in the picture above but scaling with the font size. It still looks like 1.8em is the magic distance for some reason...
Given your code, you've set up your ul such that it has no margin or padding. However, you've set up your li's such that they have margin-left: 1.8em:
#nav li ul li ul li {
display: list-item;
margin-left:1.8em;
list-style:disc outside none;
}
#nav li ul li ul li {
margin-left: 1.8em;
padding-left: 0;
}
And there it is.
You should definitely do a CSS reset and then set the properties the way you need them. Never trust browsers to be consistent. It adds a bit of coding but at the same time future proofs your code.
Based on many years of inconsistent browsers - I'd say you can't trust them to ever be consistent. The best option is to forcibly control it yourself.
You can use that by simultaneously setting the padding-left and margin-left of an li. eg:
li {
margin-left: 1.8em;
padding-left: 0;
}
Apparently some (mainly older) browsers use padding and some margin - so be sure to set both.
To answer the question and your comment: your solution works because you negate the padding with the exact same size margin. But the spacing to the left of the list is larger with the larger font size. You would get the same result with 1em padding and -1em margin or 20px and -20px.
As I mentioned in the comment, the actual default padding for lists is 40px. To make things even more confusing, on checking the user agent stylesheets (in Chrome Dev Tool and Firebug for Firefox) they report unique CSS properties: -webkit-padding-start or -moz-padding-start respectively.
I assume that these special properties are used in place of regular padding due to lists being a special case in HTML - they have hanging bullets/numbers that don't count in the padding.

How can I fix this strange IE 8 img anchor hover behaviour?

If I add this to my CSS...
small a:hover, a:hover {background-color: #CCC; }
This happens to all images that are also links when viewing in IE 8 (fine in firefox)...
They look right...
http://notails.com/nothover.jpg
until I hover over them...
http://notails.com/hover.jpg
If I remove the line of CSS the behaviour goes away. I've tried googling this but I just get unrelated problems.
By default, images align their bottom edges with the baseline of the text. That grey space you're seeing is the space below the baseline, used by decenders like q, p, y, etc. (The fact that you have no text is irrelevant - space for descenders is still reserved.)
You can get rid of it like this:
a img { /* You might want to make this rule more specific! */
vertical-align: bottom;
}
See That mysterious gap under images for a full discussion of this.
You might also try setting line-height on that item to 0.
try
a {
margin: 0px;
padding: 0px;
}
I think you probably need to set the border for the image to none, so border:none;

List styles not displaying

On this page: http://catonthecouchproductions.com/fish/boat-captain.html I have a list on the bottom right box in yellow, but it is not displaying as a list-style-type:circle, but i have it set in my CSS.
I am not sure why it is acting this way. Any ideas?
I have FireBug installed and it doesn't seem like anything is conflicting with it.
You need to add a left-margin to li to get them to show up.
ul li { margin-left: 10px; }
should do it
You haven't left any space for the circle to display - try margin:1px 10px; on the ul li instead
list-style-type:circle; should be defined for the ul and not the li.
Add a padding to the ul element that has been reset by reset.css.
Another detail, that I saw: your <ul> element has list-style-type:disc; and the <li> elements list-style-type:circle;. This property should only be declared for the <ul> element.
I had the same problem, when floating li.
As soon as I removed float from li element, the circles in ul showed up in IE7.

Resources