In css examples, I've seen rules defined starting with a .
and some starting with #
- sometimes these are mixed in the same file. What is the difference between these rules:
h1 { font-size:18pt;} .new-alerts { font-size:11pt; font-weight:bold;} #old-alerts { position:relative; font-size:10pt; }
Are they referenced differently on the html page? Is it how the properties are inherited?
() is a tuple: An immutable collection of values, usually (but not necessarily) of different types. [] is a list: A mutable collection of values, usually (but not necessarily) of the same type.
In general, using & implies a much more informal tone than and. You will never be criticized for using and, whereas you run the risk of disapproval if you use & in anything but informal notes, tweets and the like. "&" is also often used in company names or titles, i.e. Barnes & Noble.
There is no difference at runtime. The only difference between the two types of quotes is the one you have already pointed out: Single quotes need to be escaped inside single quoted string literals but not inside double-quoted string literals.
if we are told to find the difference between 3 and 5, then we usually subtract 3 from 5 ,5-3=2 and thus, we say that the difference is 2.
.
refers to a class. <span class="one" />
could be selected with .one
.
#
refers to an ID. <span id="one" />
could be selected with #one
.
You should be using classes when there could be more than one of a given element, and IDs when you know there will only be one. #navigation-bar
would be using an ID because you will only have one navigation bar in your layout, but .navigation-link
would be using a class name because you will have multiple navigation links. (It'd be better practice to use #navigation-bar a:link
to get the navigation links, but you get my point.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With