The ID Selectors

You can define style rules based on the id attribute of the elements. The ID Selectors denoted by # keyword

Example

#box

{

color: #000000;

}

Grouping Selectors

You can apply a style to many selectors by separate selectors with a comma.

 Example:

h1, h2, h3

{

color: red;

text-transform: lowercase;

font-size:15px;

}

*These properties will be applicable to h1, h2 and h3 element.

 The Attribute Selectors

You can also apply styles to HTML elements with particular attributes.

Example:

input[type=”text”]

{

color: red;

width:300px;

}

The advantage to this method is that the these properties will applied only to the text boxes and not to button or radio button. (Because if we will create a rule of input only then it will cover all elements starts with input tag).

 The Child Selectors

The Child Selectors are very similar to descendants but have different functionality.

Example:

<style>

body > p

{

font-size:18px;

}

</style>

This rule will render the entire paragraphs font in 18px if they are a direct child of the <body> element. Other paragraphs would not have any effect of this rule. 

The Universal Selectors

The Universal Selectors are used to cover all elements within a document so the same is also called as page properties

Example

<style>

* {

color: green;

}

</style>

The above property will apply on the content of every element in our document

author image

About admin

You Might Also Like...

Webs Jyoti Corporate Training
The FOR Loop

11 Comments

  1. Hi this is somewhat of off topic but I was wondering if blogs use WYSIWYG
    editors or if you have to manually code with HTML. I’m starting a blog
    soon but have no coding experience so I wanted to get guidance from someone
    with experience. Any help would be greatly appreciated!

  2. Thank you for some other informative site.
    The place else may I get that type of info written in such a perfect way?

    I have a mission that I’m simply now running on, and I
    have been at the look out for such information.

  3. I do not know whethner it’s just me or if perhaps everybody else experiencing problems
    with your blog. It appears lijke some of the written text in your poets are running off thhe screen. Can someone else please provide
    feedback annd let me know if this is happening to them too?
    This may be a problem wirh my browser because I’ve had this happen previously.
    Appreciate it

  4. magnificent points altogether, you simply won a new reader.
    What might you recommend in regards to your put up that
    you simply made some days ago? Any certain?

  5. Having read this I believed it was extremely informative.
    I appreciate you finding the time andd energy to put this short article together.

    I once agwin find myself personally spending a lot
    of time both reading and leaving comments. But so what, it was still worthwhile!

  6. Wonderful goods from you, man. I have take into account your stuff prior to and you’re just extremely
    magnificent. I actually like what you’ve obtained right here, certainly like what you’re stating and the way in which you are
    saying it. You’re making it entertaining and you continue to take care of to keep
    it smart. I cant wait to learn far more from you. That is really
    a great site.

  7. That is a good tip particularly to those new to the blogosphere.
    Simple but very precise info… Appreciate your sharing this one.

    A must read post!

  8. Good post. I learn something new and challenging on websites I stumbleupon everyday.
    It will always be exciting to rrad content from other writers and practice something from their sites.

  9. Hi, I do think this is аn exceⅼlent site. Ӏ stumbledupon it
    😉 I may come ƅɑck once again since I bookmarked it.

    Money and freedom is the best way to change, may you be rich аnd continue tо guide other people.

  10. Nice ѡeblog here! Als᧐ your web site lots up fast!

    What host are you using? Can I am getting your affіliate lіnk to your host?
    I wish my site loaded up as quіckly as yours
    lol

Leave a Reply

Your email address will not be published.

Enjoy the tutorial? Please spread the word :)

Follow by Email
Facebook
Facebook
Google+2k
Google+
http://hirdeshbhardwaj.com/2017/04/17/first-post-wordpress
YouTube82
YouTube