html - 悬停在边框上而不是菜单上

标签 html css wordpress

嘿,我在 wordpress 上制作了一个菜单,但问题是它悬停并仅在悬停在边框底部而不是单词上时单击列表项

标题.php

<?php
/**
 * The Header
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package Cryout Creations
 * @subpackage parabola
 * @since parabola 0.5
 */
 ?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<?php  cryout_meta_hook(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
    cryout_header_hook();
    wp_head(); ?>
</head>
<body <?php body_class(); ?>>

<?php cryout_body_hook(); ?>

<div id="wrapper" class="hfeed">

<?php cryout_wrapper_hook(); ?>

<div id="header-full">

<header id="header" >

<?php cryout_masthead_hook(); ?>
<div class="header_end">
<div class="header_bottom" >
        <div id="masthead" >
<ul id="branding" role="banner" >

            <li>    <?php cryout_branding_hook();?></li>
            <li>    <?php cryout_header_widgets_hook(); ?></li>



</ul>
<div class="menu_header">
<nav  role="navigation" #id="link-center">

                <?php cryout_access_hook();?>
            </nav><!-- #access -->
</div>
</div>


<br>
        </div><!-- #masthead --><br>

    <div style="clear:both;height:1px;width:1px;"> </div>
<div class="slideshow">
    <?php 
    echo do_shortcode("[metaslider id=5]"); 
?>
</div>
</header><!-- #header -->
</div><!-- #header-full -->
<div id="main">
    <div  id="forbottom" >
        <?php cryout_forbottom_hook(); ?>

        <div style="clear:both;"> </div>

        <?php cryout_breadcrumbs_hook();?>

菜单类的 css 部分:

.menu_header nav
{
    float:left;
        width: 714px;
    height: 53px;
    padding:0px;
    list-style:none;
        color: #d9d1c1;
        margin-left: 95px;

}

.menu_header ul li
{
    float:left;
           margin-top: -30px;


}

.menu_header ul li a
{
   float: left;
    font-family: Arial, Helvetica, sans-serif;
    text-decoration: none;
        color: #f1ec4b;
            font-size: 24px;
             padding-left: 9px;
    padding-right: 9px;
    margin-left: 9px;
       line-height: 30px;
           border-bottom: 3px solid #f1ec4b;


}

.menu_header ul li a:hover
{
    color: #fff;
}
.menu_header ul li:hover
{
    color: #fff;
}
.menu_header ul li a p {
    font-size: 24px;
    color: #f1ec4b;

}

当我试图删除链接的边框时,链接已损坏,我不知道究竟是什么让鼠标悬停在边框上?

最佳答案

HTML 结构和 css 代码完全错误地编写,为了让你开始我已经纠正了很多以使菜单至少工作

#branding {
width:200px;
}

.menu_header{
margin-left:0;
width: 724px;
margin-top: 80px;
}
.menu_header nav{
width:auto;
margin-left:0;
}
.header_end{
height:auto;
margin-top:0;
}
.menu_header ul li{
margin-top:0;
}

请将其添加到文件的最后,显然它会改变外观,但当 html 不牢固时,无能为力

关于html - 悬停在边框上而不是菜单上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33143135/

相关文章:

html - 透明滚动条轨道(div)

html - 正确缩放网站以在 iPhone 中显示

wordpress - 无法使用UA和GTM触发事件-事件等于gtm.js条件不匹配

java - 将JAR游戏嵌入Wordpress网站

javascript - 为什么 tinymce 没有出现在动态添加的文本区域

css - 如何应用自定义 css 将帖子拆分为多个页面

css - 为什么 translate3d 动画暂停以简化计时器功能?

javascript - 关闭时更改下拉列表的颜色

php - 获取woocommerce购物车总量

javascript - 为什么自闭合脚本标签不会触发错误?