That makes sense and it’s how I originally had it, but I had an issue with the :hover part because if I put it on the
@ChristopherBurton @kgscott284 In this case, I simply used the markup that was provided. The fix that I use depends on the design; if I am working with ems then using
font-size: 0; means that any child elements will have a font-size of 0 (I often use ems for responsive designs as it makes it much easier to adjust font sizing across the board for different sized screens). Another fix I often use is
@enjay My personal preference would be to use inline-block over floats, and I wrote up why here: http://joshnh.com/2012/02/why-you-should-use-inline-block-when-positioning-elements/
That doesn’t mean that I am right, but I’m sure you can make an educated decision once you know all the facts!
joshua, with all due respect, your ‘facts’ are somewhat twisted to bolster the use of inline-block. I have nothing against using it, but I also have nothing against floats either (which you seem to have). The right tool for the job… In this simple case of left aligned navigation there is absolutely zero benefit to using inline-block over float. In fact, you need more (albeit little) css to use inline-block than floats.
@Wolfcry911 Please let me know of any facts that I have twisted, as this was not my intention. If you are able to list them for me, I will amend them in the article. The piece is obviously biased, but I certainly am not trying to mislead anybody. I was very careful to make sure that I never stated that using floats is wrong.
In my opinion, display-inline is a more powerful tool when aligning elements for layout purposes. That of course, is just my opinion, and as I have already stated above, it does not mean that I am right!
My intention wasn’t to start a flame war, but simply to provide @enjay with a little more information so that they can make their own decision. I offered my opinion (as you did also), and then included some additional material I had written to offer some insight as to why.
You must be logged in to reply to this topic.
*May or may not contain any actual "CSS" or "Tricks".