/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Unfamiliar Hacks

Does anyone know what the and > hacks do in CSS? I don’t even know how to being google-ing that…

examples:

[B]div {float:left;}[/B]

and

[B]li > ul {…}[/B]

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Aug 08.2008 — The child hack (not really a hack anymore) gives the rule to more modern browsers (all recent versions of Firefox, Opera and Safari, and IE 7+). It's the child selector, and will only select direct descendants.<i>
</i>&lt;!-- selector: #outer &gt; div --&gt;
&lt;div id="outer"&gt;
&lt;div&gt;
&lt;!-- Gets me --&gt;
&lt;div&gt;
&lt;!-- doesn't get me --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;


The backslash hides the rule from IE 5.x, it's known as the box model hack, and was normally used to give an alternative width to divs for IE 5.x since the box model was broken badly in that browser.

Both are outdated and unnecessary.
Copy linkTweet thisAlerts:
@dtm32236authorAug 08.2008 — Cool - Thanks a lot Declan1991
×

Success!

Help @dtm32236 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...