- This topic is empty.
-
AuthorPosts
-
March 24, 2012 at 5:58 pm #37323
Al3ks
ParticipantHi everyone,
I have discovered a problem with Google Chrome. When I have elements in
tags and style them to give them a background color in google chrome there are thin white lines after each
- ....
But in firefox and IE it doesn’t show this.
is there a way to fix this, maybe a special bit of css to add?
March 24, 2012 at 6:22 pm #99865Senff
ParticipantA little more info perhaps? A standard list with elements with background color don’t show any white lines for me in Chrome: http://jsfiddle.net/senff/pQ9UH/1/
March 24, 2012 at 7:44 pm #99868Al3ks
ParticipantI think it might me when using
Take a look at this:March 24, 2012 at 9:27 pm #99876Senff
ParticipantStill don’t see any white lines there, sorry….
But why use spaces in the first place? Current day CSS can space out items much better/easier. Also, I would suggest two columns placed next to eachother.
March 24, 2012 at 10:00 pm #99878Senff
ParticipantTo go a little off-topic here: is this clearfix method still the way to go nowadays? Or perhaps again? Personally, I never preferred the :after thing (big supporter of separating content and layout), and I use overflow:hidden or a float on the container element to make it wrap its contents, but if that is already outdated (again), I’d be happy to hear about it! :)
March 24, 2012 at 10:09 pm #99881Senff
ParticipantI know what you mean, I wouldn’t use an additional clearing div either. But what I meant, is your method of clearfixing still the preferred/recommended method? I thought it was not needed anymore at all — by putting overflow:hidden on the containing element, or floating it.
It’s details I know, but was just wondering what today’s unofficial “standard” is for clearfixing.
EDIT: see final paragraph of Nicholas’ article ;)
March 24, 2012 at 10:22 pm #99884Senff
ParticipantI think you misunderstand me. ;)
In this very example, you use the
content:""
method on the footer to clear it. Without that clearing, the footer just doesn’t wrap around the lists: http://jsfiddle.net/mnFNQ/4/ (gave the footer a border so it’s clear that it doesn’t have a height and that the lists aren’t “in” it).So to fix this, you could use the clearfix method, but (in my humble opinion) it’s a lot simpler to just give the footer the property overflow:hidden: http://jsfiddle.net/mnFNQ/5/
Which is my personal preference to clear floats, over the
content:""
method.Anyways, never mind!
March 25, 2012 at 8:25 am #99904wolfcry911
Participant@Senff There is no one best way to clear, or more correctly – contain, floats. It’s best to know the different methods and apply them in the situation that warrants it. I personally still use overflow: hidden; over 90% of the time.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.