/    Sign up×
Community /Pin to ProfileBookmark

What is difference div.visiblemsg and #visiblemsg?

What is actually difference div.visiblemsg and #visiblemsg?
It seems working on website div.visiblemsg even I put ID in styled element

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@KorMar 16.2009 — [B]div.visiblemsg{}[/B] - sets the CSS properties for [I]all the DIV[/I] elements (tags) which have the [COLOR="Blue"]class="visiblemsg"[/COLOR]

[B]#visiblemsg {}[/B] - sets the CSS properties for the element (the [I]unique[/I] element) which has the [COLOR="Blue"]id="visiblemsg"[/COLOR]

The [COLOR="Blue"]#[/COLOR] (id) reference overpasses/overwrites the compounded [COLOR="Blue"]tag.class[/COLOR] reference
Copy linkTweet thisAlerts:
@KorMar 16.2009 — Example:
<i>
</i>&lt;style type="text/css"&gt;
div.visiblemsg{
color:#FF0000;
}
#visiblemsg {
color:#0000CC;
}
&lt;/style&gt;
...

&lt;div class="visiblemsg"&gt;red&lt;/div&gt;
&lt;div class="visiblemsg"&gt;red&lt;/div&gt;
&lt;div class="visiblemsg" id="visiblemsg"&gt;blue&lt;/div&gt;

Copy linkTweet thisAlerts:
@toplisekauthorMar 16.2009 — Thank you.
×

Success!

Help @toplisek 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.6,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...