Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2010, 06:35 PM   PM User | #1
stfc_boy
Regular Coder

 
Join Date: Jun 2007
Posts: 310
Thanks: 86
Thanked 3 Times in 3 Posts
stfc_boy is an unknown quantity at this point
Help with ul & li elements

Hello,

I'm struggling with something. I've put together a video player and it all works fine.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>

<style type="text/css">
	#vidcontainer{width:642px; margin:0px auto; background-color:#FFffff; padding:20px;overflow:auto}
	#video-holder {width:320px; height:248px; display:block; border:#000 1px solid; float:left;}
	ul.the_menu {margin-top:0px;}
	li.the_menu{width:265px;list-style-type:none; border:#888 1px solid; padding:4px; margin:0 0 4px 0; background:#eee;}
	li.the_menu{width:265px;list-style-type:none; border:#888 1px solid; padding:4px; margin:0 0 4px 0; background:#eee;}
	li:hover.the_menu {background:#0066CC}
	#listing{float:left;}
</style>

</head>

<body>
<div id="container">

<!-- Video Holder --> 
        <div id='video-holder' rel='http://www.youtube.com/v/0Bmhjf0rKe8&amp;hl=en&amp;fs=1' title='The First Video'></div>
		
        <div id="listing">
        <ul class="the_menu">
       <li rel='http://www.youtube.com/v/0Bmhjf0rKe8&amp;hl=en&amp;fs=1' title='The First Video'>video 1<br />Quick Title</li>
     <li rel='http://www.youtube.com/v/tgbNymZ7vqY&amp;hl=en&amp;fs=1' title='The Second Video'>video 2<br />Quick Title</li>

    <li rel='http://www.youtube.com/v/0Bmhjf0rKe8&amp;hl=en&amp;fs=1' title='The Third Video'>video 3<br />Quick Title</li>
    <li rel='http://www.youtube.com/v/tgbNymZ7vqY&amp;hl=en&amp;fs=1' title='The First Video'>video 4<br />Quick Title</li>
    <li rel='http://www.youtube.com/v/0Bmhjf0rKe8&amp;hl=en&amp;fs=1' title='The Second Video'>video 5<br />Quick Title</li>
      <li rel='http://www.youtube.com/v/tgbNymZ7vqY&amp;hl=en&amp;fs=1' title='The Third Video'>video 6<br />Quick Title</li>
        </ul>

</div>

</div>

</body>
</html>
Now my question is how do I make the UL and LI elements belong to a div element called the_menu? as I have other UL & LI elements a on the page which overwrites the styles.

Thanks
stfc_boy is offline   Reply With Quote
Old 01-09-2010, 07:06 PM   PM User | #2
effpeetee
Senior Coder

 
effpeetee's Avatar
 
Join Date: Feb 2007
Location: Clapham Junction - London SW
Posts: 4,884
Thanks: 228
Thanked 204 Times in 203 Posts
effpeetee is an unknown quantity at this point
Code:
li.the_menu{
  width: 265px;
  list-style-type: none;
  border: #888 1px solid;
  padding: 4px;
  margin: 0 0 4px 0;
  background: #eee;
}

li:hover.the_menu {
  background: #0066CC;
}
I would have expected to see.

the_menu li{

The overall id goes first followed progressively by the later ones.

There is a wealth of help here.

Frank
__________________
* Sources (updated: 21.11.2012.
Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.
effpeetee is offline   Reply With Quote
Old 01-09-2010, 07:26 PM   PM User | #3
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
Quote:
Originally Posted by effpeetee View Post
I would have expected to see.

the_menu li{
Forgot the dot for the class: .the_menu li{

And to the OP, your div isn't called the_menu - that's the ul.
__________________
Are you a Help Vampire?
tomws is offline   Reply With Quote
Old 01-09-2010, 08:10 PM   PM User | #4
effpeetee
Senior Coder

 
effpeetee's Avatar
 
Join Date: Feb 2007
Location: Clapham Junction - London SW
Posts: 4,884
Thanks: 228
Thanked 204 Times in 203 Posts
effpeetee is an unknown quantity at this point
Quote:
Originally Posted by tomws View Post
Forgot the dot for the class: .the_menu li{

And to the OP, your div isn't called the_menu - that's the ul.
Thanks for picking that up. My sight is poor. I didn't notice the missing dot.

Frank.
__________________
* Sources (updated: 21.11.2012.
Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.
effpeetee is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:29 PM.


Advertisement
Log in to turn off these ads.