What does the dot before the variable indicate in html?

I am new to html and web coding in general. What do the periods before the variables indicate in the following code?

<style>
<!-- Modify these styles -->
.page_title       {font-weight:bold}
.page_text        {color:#000000}
</style>
... JS code

thank

+5
source share
4 answers

these are not variables. This is a CSS selector, and they represent an HTML node with this class for example

<div class="page_title">Page Title</div>

You use CSS Selectors to style these elements in HTML.


Since they suggested. =)

There are several ways to link to HTML nodes in CSS, the most common being identifiers, classes, and a tag name.

take a look at this example

<div>
    <ul id="first_set">
       <li class="item"> Item 1 </li>
       <li class="item"> Item 2 </li>
    </ul>
    <ul id="second_Set">
       <li class="item"> Item 1 </li>
       <li class="item"> Item 2 </li>
    </ul>
</div>

Ok we have a div with two unordered lists, each list is like two lists, now CSS:

div { background-color: #f00; } 
#first_set { font-weight: bold; }
#second_set { font-weight: lighter; }
.item { color: #FF00DA }

div <div> HTML, # , #first_set ,

<ul id="first_set">

, .item ,

<li class="item">

, , :

#first_set .item { text-decoration: underline; }

, #first_set.


, ( #myID) ONCE HTML-, . , ; . (, <li class="item special-item">) - Platinum Azure

+14
0

- , ,

.treeListContainer input

treelistcontainer - , input - ,

0

, , - CSS, HTML. CSS, HTML , .

, HTML, .

, , .

This way .page_titlewill match element c:

class="foo page_title bar baz"

Generally speaking, everything you specify for a class name such as "page_title" is likely to be the same as the main title, so HTML should usually look like this:

<h1>Main heading goes here</h1>

And CSS:

h1 { … }

By the way, this <!-- Modify these styles -->is a bug in HTML (and compatible with HTML XHTML). CSS comment is divided into /*and */.

0
source

All Articles