Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Sep 2012
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    change menu from horizontal to vertical in css

    Hello all, I built a horizontal menu and now I have to change it to vertical. Is there away to change mine with out starting it from scratch? I know my Navigation is in a table and it shouldn't. I'll fix it after.


    Code:
    ul#css3menu1,ul#css3menu1 ul{
    	margin:0;list-style:none;background-color:#000;background-image:url("mainbk.png");background-repeat:repeat;border-width:0px;border-style:solid;border-color:#999999;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
    ul#css3menu1 ul{
    	display:none;position:absolute;left:0;top:100%;-moz-box-shadow:0.7px 0.7px 1px #777777;-webkit-box-shadow:0.7px 0.7px 1px #777777;box-shadow:0.7px 0.7px 1px #777777;padding:0 9px 9px;background-color:#000;background-image:none;border-width:1px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border-style:solid;border-color:#000;}
    ul#css3menu1 li:hover>*{
    	display:block;}
    ul#css3menu1 li:hover{
    	position:relative;}
    ul#css3menu1 ul ul{
    	position:absolute;left:100%;top:0;}
    ul#css3menu1{
    	padding:1px 1px 1px 0;display:block;font-size:0;float:left;}
    ul#css3menu1 li{
    	display:block;white-space:nowrap;font-size:0;float:left;}
    ul#css3menu1>li,ul#css3menu1 li{
    	margin:0 0 0 1px;}
    ul#css3menu1 ul>li{
    	margin:1px 0 0;}
    ul#css3menu1 a:active, ul#css3menu1 a:focus{
    	outline-style:none;}
    ul#css3menu1 a,ul#css3menu1 a.pressed{
    	display:block;vertical-align:middle;text-align:left;text-decoration:none;font:bold 16px Arial;color:#cccccc;cursor:default;}
    ul#css3menu1 ul li{
    	float:none;margin:9px 0 0;}
    ul#css3menu1 ul a{
    	text-align:left;padding:8px 0 0 0;background-color:#000;background-image:none;border-width:1px 0 0 0;border-style:solid;border-color:#262626;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;font:16px Arial;color:#ffffff;text-decoration:none;}
    ul#css3menu1 li:hover>a{
    	background-color:#00c4ff;border-style:none;font:bold 16px Arial;color:#ffffff;text-decoration:none;background-image:url("mainbk.png");background-position:0 100px;}
    ul#css3menu1 img{
    	border:none;vertical-align:middle;margin-right:10px;}
    ul#css3menu1 img.over{
    	display:none;}
    ul#css3menu1 li:hover > a img.def{
    	display:none;}
    ul#css3menu1 li:hover > a img.over{
    	display:inline;}
    ul#css3menu1 li a.pressed img.over{
    	display:inline;}
    ul#css3menu1 li a.pressed img.def{
    	display:none;}
    ul#css3menu1 span{
    	display:block;overflow:visible;background-position:right center;background-repeat:no-repeat;padding-right:0px;}
    ul#css3menu1 a{
    	padding:10px;background-color:#000;background-image:url("mainbk.png");background-repeat:repeat;background-position:0 200px;border-width:0px;border-style:none;border-color:;color:#FFF;text-decoration:none;}
    ul#css3menu1 li:hover>a,ul#css3menu1 li>a.pressed{
    	background-color:#fff;background-image:url("mainbk.png");background-position:0 100px;border-style:none;color:#000;text-decoration:none;}
    ul#css3menu1 ul li:hover>a,ul#css3menu1 ul li>a.pressed{
    	background-color:#fff;background-image:none;border-style:solid;border-color:#262626;font:16px Arial;color:#000;text-decoration:none;}
    ul#css3menu1 li.topfirst>a{
    	height:16px;line-height:16px;border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;-webkit-border-radius:4px;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;text-shadow:#000000 0px -1px 1px;}
    ul#css3menu1 li.topfirst:hover>a,ul#css3menu1 li.topfirst>a.pressed{
    	line-height:16px;text-shadow:#3d3d3d 0px -1px 1px;}
    ul#css3menu1 li.topmenu>a{
    	height:16px;line-height:16px;text-shadow:#000000 0px -1px 1px;}
    ul#css3menu1 li.topmenu:hover>a,ul#css3menu1 li.topmenu>a.pressed{
    	line-height:16px;text-shadow:#3d3d3d 0px -1px 1px;}
    ul#css3menu1 li.toplast>a{
    	height:16px;line-height:16px;border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;-webkit-border-radius:0;-webkit-border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;text-shadow:#000000 0px -1px 1px;}
    ul#css3menu1 li.toplast:hover>a,ul#css3menu1 li.toplast>a.pressed{
    	line-height:16px;text-shadow:#3d3d3d 0px -1px 1px;}
    ul#css3menu1 ._>li>a{
    	padding:0;}
    ul#css3menu1 li.subfirst>a{
    	border-width:0;border-style:none;padding:0;}
    ul#css3menu1 li.subfirst:hover>a,ul#css3menu1 li.subfirst>a.pressed{
    	border-style:none;}
    Code:
    <ul id="css3menu1" class="topmenu">
    	<li class="topfirst"><a href="index.html" title="Home" style="width:120px;height:16px;line-height:16px;">Home</a></li>
    	<li class="topmenu"><a  href="#" title="#" style="width:120px;height:16px;line-height:16px;"><span>Destinations</span></a>
    	<ul>
    		<li class="subfirst"><a href="#" title="North America">North America</a>
                <ul>
    						<li><a href="#">Canada</a></li>
    						<li><a href="#">Cuba</a></li>
                            <li><a href="#">Mexico</a></li>
                            <li><a href="#">Suriname</a></li>
                            <li><a href="#">United States</a></li>
    					</ul>
    				</li>
    		<li class="subfirst"><a href="#" title="Central America">Central America</a>
                        <ul>
    						<li><a href="#">Costa Rica</a></li>
    						<li><a href="#">EI Salvador</a></li>
                            <li><a href="#">Guatemala</a></li>
                            <li><a href="#">Honduras</a></li>
    						<li><a href="#">Nicaragua</a></li>
                            <li><a href="#">Panama</a></li>
                            <li><a href="#">Turks And Caicos Islands</a></li>
    					</ul>
    				</li>
    		<li class="subfirst"><a href="#" title="South America">South America</a>
            <ul>
    			<li><a href="#">Argentina</a></li>
    			<li><a href="#">Bolivia</a></li>
                <li><a href="#">Brazil</a></li>
                <li><a href="#">Chile</a></li>
    		    <li><a href="#">Columbia</a></li>
                <li><a href="#">Ecuador</a></li>
                <li><a href="#">French Guiana</a></li>
    			<li><a href="#">Guyana</a></li>
                <li><a href="#">Paraguay</a></li>
                <li><a href="#">Peru</a></li>
    			<li><a href="#">Uruguay</a></li>
                <li><a href="#">Venezuela</a></li>			
    			</ul>			
    				</li>		
            <li><a href="#" title="Patio's">Europe</a></li>
            <li><a href="#" title="Patio's">Caribbean</a></li>
            <li><a href="#" title="Patio's">Africa</a></li>
            <li><a href="#" title="Patio's">Middle East</a></li>
            <li><a href="#" title="Patio's">Australia</a></li>
            <li><a href="#" title="Patio's">Asia</a></li>
        </ul>
    	</li>
    	<li class="topmenu"><a href="resources.html"  style="width:120px;height:16px;line-height:16px;"><span>Resources</span></a></li>
    	<li class="topmenu"><a href="comments.html"  style="width:120px;height:16px;line-height:16px;"><span>Comments</span></a></li>
        <li class="topfirst"><a href="contact.html" title="Contact" style="width:120px;height:16px;line-height:16px;">Contact</a></li>
    
        </ul>
    	</li>
        
    </ul></center>
    </div>
    Last edited by charisma44; 10-12-2012 at 04:08 PM.

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    402
    Thanks
    2
    Thanked 31 Times in 31 Posts
    I suspect that with the table for layout combine with the use of depreciated and obsolete attributes/tags that you might as well start over, because what you have is going to be more work to fix than doing a modern vertical which is a really simple thing to do.

    Also the small amount of code you posted does not give any context. A link to the page would provide more information.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    Regular Coder
    Join Date
    Sep 2012
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can remove the table would that help?

  • #4
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    402
    Thanks
    2
    Thanked 31 Times in 31 Posts
    What would help is a link to the page. Hacking away a bits an pieces is not the way to fix problems. Without context is is like asking your barber to cut your hair blindfolded.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #5
    Regular Coder
    Join Date
    Sep 2012
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is what I did and it worked.

    1. Remove float from "ul#css3menu1 li".

    2. Change top to 0 for "ul#css3menu1 ul".

    3. Add left: 100%; to "ul#css3menu1 ul".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •