- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi
in this markup:
The h1 and the span, elements are both floated to le left. How would you clear the float to prevent the link from going up… I have seen clearing the float by floating the link aswell, witch is not necessary.
Do you think its bad practies?
Thanks, it only works if the anchor is displayed to block…
You could also add a ::before pseudo-selector to the anchor.
Example: http://jsfiddle.net/J6nKE/
The simplest method is to do what @wolfcry911 first said, set the anchor to clear: left; and then add display: block; which you also mentioned…
@joshuanhibbert
Right, and that’s fine if the anchor can be set to block without causing other design problems, but based on Hand2Mouth’s comment, I assume the anchor has to remain as an inline element, in which case the ::before selector will work.