Forum : some doubts related to mydivexample.html
Brief description  about Online courses   join in Online courses
View Gopinath Raghurama Damale 's Profile

some doubts related to mydivexample.html

Sir,
I have a couple of doubts regarding mydivexample.html provided in the css tutorial.

1) why have you declared some ids twice?
for ex: #leftpart{
float:left;
width:200px;}

#leftpart{
background-color: #FDE07B;
padding:10px;
}

2) What is the meaning of syntax below used in declaring styles?
#homebutton ul
#homebutton ul li
#homebutton ul li a
#homebutton ul li a:hover
#homebutton ul li #active

3) <li class="style1" style="margin-bottom:15px;">
<a href="#" class="style5" id="active">About us </a></li>
In the above code, why do we use a separate class 'style5', though we are already using 'style1' class in the list tag? Also, why to use a inline style, when we could have included in the style1 class?

4) <div id="login2"><input name="" type="text" / style="width:100px;"></div>
Why do you use / before inline style?
Asked by Gopinath Raghurama Damale | Jul 5, 2010 |  Reply now
Replies (4)
View gopinath raghurama damale 's Profile
thank you very much, sir.
Jul 7, 2010
View teacher siliconindia 's Profile
Hi

1.

#homebutton ul
#homebutton ul li
#homebutton ul li a
#homebutton ul li a:hover
#homebutton ul li #active

#homebutton this is div id name

#homebutton ul this means in that div unordered list some text

#homebutton ul li this means in that div unordered list text your making Horizontal

#homebutton ul li a this means in that div if you give link to text how it should come

#homebutton ul li a:hover when hover the text how it should show


2. <div id="login2"><input name="" type="text" / style="width:100px;"></div> .

No need to put "/" before style that is a mistake

Regards
Jul 6, 2010
View gopinath raghurama damale 's Profile
Thanks for your reply. I am satisfied with the answers to question no. 1 & 3. But I couldn't get the intended answer for questions 2 & 4.
Let me try to put these questions in another way...

1) I know that style selector can be in different formats like-
p{........}, h2{.......}, a:visited{.........},
p,h2,h3{.......... }, .class1{.....} or #id1{.......} etc.
I know the meanings and also how they are used.

But I don't know the format like #homebutton ul li a{.......}
or #homebutton ul li #active{.....}. How do you explain the selector format here? Why are there multiple spaces between selectors and what is its meaning?

2) <div id="login2"><input name="" type="text" / style="width:100px;"></div> .
Here why do we use '/' symbol before style attribute?

Hope my questions are clear now.
Jul 6, 2010
View teacher siliconindia 's Profile
Hi

1. No problem you can declared in one place only,

2. In HTML, there are two types of lists:
unordered lists - the list items are marked with bullets (UL)
ordered lists - the list items are marked with numbers or letters (OL)
<li> s for Horizontal Navigation
3. a. Style1 for total content
b. <a href="#" class="style5" id="active">about us </a></li>
here style5 for only about us

4. Using inline style rules is perhaps the easiest place to begin experimenting with CSS. Let's say that we want to change the color, size, styling (i.e. we want to underline a string of text) of a single paragraph using the <p> tag.
We write this HTML markup:

<p style="text: 20px; color: blue; text-decoration: underline;">

Regards

Jul 6, 2010