1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is the use of class in div ?

Discussion in 'HTML & Website Design' started by cbhattarai, Feb 24, 2012.

  1. #1
    HI,

    I have seen that there are many people who use <div class="...."> i actually want to know about what is the main role of class in <div> or any other tags?

    and what all other properties can we use in <div>...
     
    Solved! View solution.
    cbhattarai, Feb 24, 2012 IP
  2. Musab Zain

    Musab Zain Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This will be helpful: w3schools .com
     
    Musab Zain, Feb 24, 2012 IP
  3. cbhattarai

    cbhattarai Active Member

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #3
    I have gone through it, but i wanted to know it in detail....

    See. I am a.Net developer (I am still learning it.) ANd i wanted to know the use of class in <div > tag or any other tags.....

    That means when i use <div class="what is that we write it and where is it integrated from">

    I hope my question has been understood to you now...
     
    cbhattarai, Feb 24, 2012 IP
  4. ivickon

    ivickon Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Perhaps the most powerful aspect of class div is that multiple classes can be applied to one HTML element. For example, you may wish to use two rules on one particular element like this:
    <div class="heading">Heading here</div>

    .heading
    {
    font-weight: bold;
    font-size: 140%;
    color: #600;
    }
     
    ivickon, Feb 24, 2012 IP
  5. cbhattarai

    cbhattarai Active Member

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #5
    the


    .heading
    {
    font-weight: bold;
    font-size: 140%;
    color: #600;
    } code is written within the html file or is it inherited from the .cs file.....?
     
    cbhattarai, Feb 24, 2012 IP
  6. cssbros

    cssbros Member

    Messages:
    76
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    43
    #6
    DIV stands for division, it was used as replacement for table coding on HTML.

    Class and ID are the 2 types of attribute you can use to style DIV codes.

    Id can be used only once while class can be used repeatedly.

    Hope that helps.
     
    cssbros, Feb 24, 2012 IP
  7. #7
    You can use CSS class name ID name with <div> tag. Div is only for use stands. As per the HTML5 standard you can use now <section>, <head> etc.
     
    creativewebmaster, Feb 25, 2012 IP
  8. cbhattarai

    cbhattarai Active Member

    Messages:
    123
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #8
    this is the answer that i was looking for. Thank for the answer. And For What is <section> tag used?
     
    cbhattarai, Feb 29, 2012 IP
  9. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #9
    I'm going to write this on my arm so I never forget it. Thanks for your helpful post.
     
    drhowarddrfine, Mar 1, 2012 IP
  10. zigvab75

    zigvab75 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It is inherited from the .css file if you are using an external file. Some people plonk the style tags right into the html but most people prefer to use an external style sheet such as style.css in a text editor and use LINK REL=StyleSheet HREF="main.css" TYPE="text/css" (with gt and lst at the beginning and end of course) in the head tag of your html page so you can style your pages simultaniously.
     
    zigvab75, Mar 1, 2012 IP