Question:

Help with tags HTML CSS: <div> <id> <class> <apan>?

by  |  earlier

0 LIKES UnLike

1.-can I use these tags ONLY on html without using css?

2.-what of these tags are used ONLY on html without using css?

 Tags:

   Report

2 ANSWERS


  1. What you mean?

    &lt;div class = &quot;div_style&gt; div stuff here &lt;/div&gt; where the css has something like:

    div.div_style {

    style font-family :Tahoma etc ;

    }

    or

    &lt;div id=&quot;route_top&quot; style=&quot;font-family: Tahoma; width: 600px;&quot;&gt; you r stuff here&lt;/div&gt;


  2. HTML is a markup language, which means it tells the browser what to display...

    CSS, cascading style sheets, works with HTML to tell the browser how to display it. For example, position, size, shape, color, etc...

    A &lt;div&gt; tag is an element in HTML, likewise is &lt;span&gt;.

    &lt;id&gt; and &lt;class&gt; do not exist as elements in HTML or CSS. id and class are used for assignment. Here&#039;s an example:

    &lt;div class=&quot;class&quot; id=&quot;id&quot;&gt; Some stuff here &lt;/div&gt;

    Explained: The &lt;div&gt; element does nothing alone - it acts kind of as a container, but with a class and/or id assigned to it you can style it with css to display however you wish...

    An external CSS file example:

    // A class is defined in CSS with a preceding &#039;.&#039;

    .class {

    width: 100px;

    height: 100px;

    background-color: #000000;

    text-align: center;

    border: 1px solid #333333;

    color: #CCCCCC;

    }

    -- Now any element with the assignment of class=&quot;class&quot; will have the attributes above.

    // An id is defined in CSS with a preceding &quot;#&quot;

    #id {

    margin: 0px 10px 0px 10px;

    padding: 10px;

    }

    -- Now any element in your HTML document with id=&quot;id&quot; will have the attributes above.

    You can learn more about HTML and CSS from w3schools.com

    Cheers!

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions