Css 标题中的可单击徽标链接

Css 标题中的可单击徽标链接,css,Css,我想添加我的可点击的公司标志的标题,这将重定向到他们的主页。我试过这个,但它使整个标题可点击 <div id="header"> <a style="display:block" href="profile.php" > <label> <img src="images/logo.png" height="50x" width="180px" /> </label>

我想添加我的可点击的公司标志的标题,这将重定向到他们的主页。我试过这个,但它使整个标题可点击

<div id="header">
    <a style="display:block" href="profile.php" >
        <label>
            <img src="images/logo.png" height="50x" width="180px" />
        </label>
    </a>
</div>

请从锚点中删除显示:块:-

<div id="header">
    <a href="profile.php" ><label><img src="images/logo.png" height="50x" width="180px" /></label></a>
</div>

使用
CSS

不要使用
内联CSS样式
。而是创建css文件并粘贴代码,并将其包含在页面中

<style type="text/css">

    div.header
    {
        display: block;
        height: 40px;
        position: absolute;
        width: 100%;
    }
    div#header a img
    {
        cursor:pointer;
    }
    .header .logo
    {
        display: block;
        float: left;
        padding: 4px 3px;
    }
    img
    {
        border: 0 none;
        height: auto;
        max-width: 100%;
        vertical-align: middle;
    }
</style>

<div class="header">
    <a href="action.php" class="logo">
        <img title="Title" alt="Alter" src="img/4.png">
    </a>
</div>

分区标题
{
显示:块;
高度:40px;
位置:绝对位置;
宽度:100%;
}
分区#标题a img
{
光标:指针;
}
.标题.徽标
{
显示:块;
浮动:左;
填充物:4px 3px;
}
img
{
边界:0无;
高度:自动;
最大宽度:100%;
垂直对齐:中间对齐;
}
试试这个

 </style> 
 div#header 
         {
         position:fixed;
        height:40px;margin:0;width:100%;
        padding-left:30px;background: #00BFFF
       }
</style> 


<div id="header">
      <a s href="profile.php" >  <img src="slider-button-left.png" height="50x" width="180px" /></a>
</div>

div#头
{
位置:固定;
高度:40px;边距:0;宽度:100%;
左侧填充:30px;背景:#00bff
}

这是
显示:块的副作用。使用它有什么好的理由吗?我试着移除它。。。什么也没发生!我去掉了那个,还是问题exists@SalmanA不要只是评论,试试你的手上,复制粘贴这段代码并运行它…它的解决方案太…你能告诉我们其他css与之相关。。因为我让它在这里工作..可能是其他css在这里起作用我的意思是你已经删除了
img
标签。可能是需要的。我已经添加了CSS部分。。。看一看现在看一看我确定现在已经完成了…我已经核对过了…见更新的答案
 </style> 
 div#header 
         {
         position:fixed;
        height:40px;margin:0;width:100%;
        padding-left:30px;background: #00BFFF
       }
</style> 


<div id="header">
      <a s href="profile.php" >  <img src="slider-button-left.png" height="50x" width="180px" /></a>
</div>