Jump to content
  • 0

css-как сделать, где искать..


kayross
 Share

Question

Добрый день. Делаю свой первый сайт и есть проблемка у меня в

css, а именно есть горизонтальное меню с родительскими элементами (приложил скрины) и мне нужно

чтобы активные пункты были другого цвета. Например, активный пунт и родительский элемент (подпункт) одного цвета - зеленого,

а другие родительские пункты (неактивные) - серого. Посдскажите пожалуйста, где и как? Спасибо -)

#mainMenu {
float: left;
width:700px;
height: 28px;
margin-top: 0;
margin-right: 0;
margin-left: 1px;
}


.menu {
        padding:0;
        color: #666;
        height: 28px;
        margin: 0;
        font-size: 10px;
        text-transform: uppercase;
}

.menu ul{
        list-style: none;
        margin: 0;
        padding: 0;
        margin-left: -11px;       
}

.menu li{
        list-style: none;
        float: left;
        color: #666;
        font-weight: normal;
font-size: 11px;
padding-right: 15px;
line-height: 26px;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
}

.menu li ul {
        position: absolute;
        width: 170px;
        left: -999em;
        background-color: #fff;
        line-height: 26px;
        z-index: 500;
        margin-left: -10px;
        border: solid 1px #ccc;
        margin-top: -1px
style=
"filter:alpha(opacity=80); /* IE 5.5+*/
-moz-opacity: 0.8; /* Mozilla 1.6 и ниже */
-khtml-opacity: 0.8; /* Konqueror 3.1, Safari 1.1 */
opacity: 0.8; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9 */ "
}

.menu li:hover ul {
        left: auto;
}

.menu li ul li {
        width: 180px;
        padding: 0;
}

.menu a {
        display: block;
        padding: 0;
        font-weight: normal;
        text-decoration: none;
        color: #666;
}

.menu a:hover {
color: #b0cf36;
font-weight: bold;
text-decoration: none;
}

html>body .menu li a {
        width: auto;
}

.menu li ul li a {
      padding-left: 20px;

     
color: #666;
}

.menu li.active,
.menu li:hover,#active_menu:link,a#active_menu:visited{
        text-decoration: none; font-weight: bold;
        color: #b0cf36;
}

.menu li ul li:hover {

}

.menu li:hover ul, .menu li.sfhover ul {
        left: auto;
}

.menu li.active a,
.menu ul li.active a {
        text-decoration: none;
        color: #b0cf36; font-weight: normal;

}

.menu li.active a,
.menu li:hover a {
font-weight: bold;
}

.menu li ul ul {
margin: -27px 0 0 120px;
}

.menu li:hover ul ul, .menu  li.sfhover ul ul {
left: -999em;
}

.menu  li:hover ul, .menu li li:hover ul, .menu li.sfhover ul, .menu  li li.sfhover ul {
left: auto;
}

.menu li:hover ul ul, .menu li:hover ul ul ul, .menu li.sfhover ul ul, .menu li.sfhover ul ul ul {
left: -999em;
}

.menu li:hover ul, .menu li li:hover ul, .menu li li li:hover ul, .menu li.sfhover ul, .menu li li.sfhover ul, .menu li li li.sfhover ul {
left: auto;
}

.menu li:hover ul ul, .menu li:hover ul ul ul, .menu li:hover ul ul ul ul, .menu li.sfhover ul ul, .menu li.sfhover ul ul ul, .menu li.sfhover ul ul ul ul {
left: -999em;
}

.menu li:hover ul, .menu li li:hover ul, .menu li li li:hover ul, .menu li li li li:hover ul, .menu li.sfhover ul, .menu li li.sfhover ul, .menu li li li.sfhover ul, .menu li li li li.sfhover ul {
left: auto;
}

543873.jpg

540801.jpg

Edited by kayross
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
А HTML где?

___

<?php
/**
* @copyright Copyright © 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.

* Template Design by iTemplater.com.

*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>

<jdoc:include type="head" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/mainmenu.css" type="text/css" />

<style type="text/css" media="all">
<?php if ($this->params->get('authorName')=='no') { ?> .author {display:none} <?php } ?>
<?php if ($this->params->get('dateCreated')=='no') { ?> .createdate {display:none} <?php } ?>
<?php if ($this->params->get('dateModified')=='no') { ?> .modifydate {display:none} <?php } ?>
<?php if ($this->params->get('Buttons')=='no') { ?> .buttons {display:none} <?php } ?>

</style>

<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/mainmenu.js"></script>

<script type="text/javascript">
function showlayer(layer){
var myLayer=document.getElementById(layer);
if(myLayer.style.display=="none" || myLayer.style.display==""){
myLayer.style.display="block";
} else {
myLayer.style.display="none";
}
}
</script>

</head>

<body>

<div class="container">
<div id="main">

<div id="logo">
<img src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/images/logo.jpg" border="0" alt="logo"></a></div>

<div id="searchBox"> <jdoc:include type="modules" name="pa_search" style="xhtml" /> </div>

<div id="menurow">
<div id="mainMenu"><jdoc:include type="modules" name="pa_mainmenu" style="xhtml" /> </div>

<?php if($this->countModules('pa_login')) { ?>
<div id="login"><a href="#" onclick="showlayer('loginpanel')">Login | Register</a>
<div id="loginpanel" style="display:none;"> <jdoc:include type="modules" name="pa_login" style="xhtml" /> </div>
</div>
<?php } ?>
</div>


<?php if($this->countModules('pa_header')) { ?>
<div id="header"> <jdoc:include type="modules" name="pa_header" style="xhtml" /> </div>
<?php } ?>

<?php if($this->countModules('pa_right')) { ?>
<div id="content"> <jdoc:include type="message" /> <jdoc:include type="component" style="xhtml"/> </div>
<div id="right"> <jdoc:include type="modules" name="pa_right" style="xhtml" /> </div>
<?php } else { ?>
<div id="content2"> <jdoc:include type="message" /> <jdoc:include type="component" style="xhtml"/> </div>
<?php } ?>

<div id="footer"> <jdoc:include type="modules" name="pa_footer" style="xhtml" /> </div>
</div>
</div>

<jdoc:include type="modules" name="debug" />

</body>
</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy