如何在我的图像周围不显示这个蓝框?

时间:2012-04-17 08:05:44

标签: html css

我有一个图像,它是一个弹出日历的链接,其中显示在我的图像周围呈现一个蓝色框架,因为我做了一个链接,使光标在悬停时变为手: enter image description here

其中HTML是

<div class="fl20">Depositionsdatum:</div>
<div class="fl40"><input type="text" size="10" name="depositionsdatum"
      id="depositionsdatum" value="">&nbsp;<a href="#"><img src="images/cal.gif" width="16"
      height="15" alt="" onclick="javascript:openCalWin('620','300','depositionsdatum')"></a></div>

CSS

 .avnamn {
color:arial #90002b;
font-size:140%;
display:inline;
vertical-align:3%;
margin-left:1%;
}

.b {
border:1px solid #000;
}

.Webdings {
font-family:Webdings;
}

ul {
margin-top:0;
}

.mt3 {
margin-top:-3px;
}

.mt5p {
margin-top:5px;
}

.fontS80 {
font-size:80%;
}

.link {
color:#036;
text-decoration:underline;
cursor:pointer;
font-weight:700;
}

.link_sm {
color:#036;
text-decoration:underline;
font-size:70%;
cursor:pointer;
}

.smallg {
font-size:75%;
color:#555;
}

.ssmall {
font-size:65%;
font-weight:700;
color:#555;
}

.small60 {
font-size:60%;
}

.small50 {
font-size:50%;
color:#333;
}

.smallb {
font-size:85%;
}

table {
display:inline;
}

h1 {
font-size:130%;
display:inline;
}

h2 {
font-size:100%;
display:inline;
}

h4 {
font-size:70%;
display:inline;
}

.hthin {
font-size:125%;
}

.th {
text-align:left;
}

td,th {
font-size:75%;
vertical-align:text-top;
}

.td_link {
cursor:pointer;
}

.td40 {
height:40px;
}

.td60 {
height:60px;
}

.thkant {
border-top:1px solid #000;
border-bottom:1px solid #000;
font-size:70%;
text-align:left;
}

.bb {
border-bottom:1px solid #000;
}

.bbV {
border-bottom:1px solid #FFF;
}

.TB_bt,.TB_nb,.TB_db,.TB_bb {
background-color:#efefdc;
}

.hk {
background-color:#d9ddb3;
}

.hknot {
background-color:#f9faf2;
}

.TB_bt {
border-top:1px solid #FFF;
}

.TB_bt5 {
border-top:5px solid #FFF;
}

.TB_bb {
border-bottom:1px solid #999;
}

.TB_bb2 {
border-bottom:2px solid #c1c1b3;
}

.TB_db {
border-bottom:1px solid #000;
border-top:1px solid #000;
}

.TB_tb {
border-top:2px solid #efefdc;
}

.TB_bo_hk {
border-top:1px solid #efefdc;
}

.TB_bo2 {
border:1px solid #efefdc;
}

.TB_bo2B {
border-top:2px solid #c1c1b3;
border-left:3px solid #efefdc;
border-right:3px solid #efefdc;
border-bottom:2px solid #c1c1b3;
}

.TD_bo {
border-right:1px solid #c1c1b3;
width:9%;
font-size:70%;
text-align:center;
}

.TD_bo2 {
border-right:0;
width:9%;
font-size:70%;
text-align:center;
}

.ytb {
border-left:3px solid #efefdc;
border-right:3px solid #efefdc;
}

.datum {
font-size:70%;
padding-right:5px;
vertical-align:text-top;
}

.sub {
background:#EAEAEA;
}

.sub_meny,.sub_meny_r,.sub_meny_active,.sub_meny_sm {
font-size:70%;
padding-left:20px;
padding-right:20px;
vertical-align:text-top;
}

.sub_meny_sm {
font-size:60%;
vertical-align:middle;
padding-left:10px;
padding-right:10px;
}

.sub_meny_r {
float:right;
font-size:70%;
padding-left:8px;
padding-right:8px;
}

.sub_meny_rm {
margin-top:4px;
}

.sub_meny_active {
font-weight:700;
}

.flikkant1 {
background-image:url(../images/fl1k.jpg);
background-position:center;
z-index:-1;
}

.inl_namn {
font-weight:700;
font-size:70%;
color:#000;
text-decoration:none;
}

.tr {
text-align:right;
}

.g1 {
background-color:#FFF;
line-height:20px;
}

.g2 {
background-color:#EEE;
line-height:20px;
}

.g3 {
background-color:#DCDCDC;
line-height:20px;
font-weight:700;
font-size:100%;
}

.g4 {
background-color:#CCC;
line-height:20px;
}

.popup {
background-color:#FFF;
font-size:70%;
border-color:#000;
border-style:groove;
border-width:2px;
padding:0;
}

.popupN {
background-color:#F0F0E3;
color:#000;
width:100%;
display:inline;
font-weight:700;
height:auto;
border-bottom:1px solid #000;
padding:2px;
}

.pin {
padding:6px;
}

.fl10,.fl20,.fl30,.fl40,.fl50,.fl60,.fl70,.fl80,.fl90,.fl100 {
padding-bottom:4px;
color:#000;
}

.over {
background-color:#EFEFDC;
line-height:20px;
}

.half {
line-height:50%;
}

.quarter {
line-height:25%;
}

.lh10 {
line-height:10%;
}

.checkmargin {
margin-right:25px;
}

.checkmarginL {
margin-left:25px;
}

.pusher {
padding-left:15px;
}

.pusherR {
margin-right:40px;
}

.rand3 {
background-color:#FFF;
line-height:3px;
}

.rand1 {
background-color:#FFF;
line-height:1px;
}

.whiteborder {
color:#fff;
border:4px solid #fff;
margin:10px;
padding:10px;
}

#details {
width:580px;
color:#fff;
}

.column1 {
color:#000;
width:500px;
border:0;
float:left;
margin:0;
padding:0;
}

.column2 {
color:#000;
border:0;
width:80px;
float:right;
margin:0;
padding:0;
}

.f200 {
color:#000;
}

.f210 {
color:#000;
float:left;
}

.inp_sel {
width:80%;
}

.form-bg {
background:#eeefdf;
width:1080px;
overflow:hidden;
}

.data-bar {
border-bottom:1px solid #fbfbf7;
display:inline-block;
padding:10px;
}

.left {
float:left;
width:200px;
}

.right {
float:right;
width:700px;
}

.data-box {
width:650px;
height:100px;
border:1px solid #cbcbcb;
}

#table td {
margin:120px;
}

.personName {
float:left;
width:300px;
}

.otherDetails {
float:right;
width:300px;
}

.readonly,.TB_nbA {
background-color:#CCC;
}

a:link,a:visited,a:hover,a:active {
color:#000;
text-decoration:none;
}

.fontS75,.small {
font-size:75%;
}

h3,h5 {
font-size:80%;
display:inline;
font-family:"Arial Unicode MS", Arial, Helvetica, sans-serif;
}

.TB_bo,.b2 {
border:2px solid #efefdc;
}

我想让图片像在同一页面上的另一个地方一样呈现: enter image description here 这里它没有蓝框,代码几乎相同:

<div id="datum" class="fl20">Datum ingivningsdag:</div>
        <div class="fl20"><input type="text" name="ingivningsdag" 
    id="ingivningsdag" value="2012-04-11">&nbsp;<a href="#"><img src="images/cal.gif" alt="" width="16" height="15" border="0" onclick="javascript:openCalWin('620','300','ingivningsdag')"></a></div>

为什么它在一个地方而不是另一个地方工作?

7 个答案:

答案 0 :(得分:4)

代码不相同。

请注意,第二个实例已设置border="0"。您需要将其设置为IMG元素的属性或(首选),使用CSS选择器设置border:none

答案 1 :(得分:4)

在询问之前你应该匹配两个代码,答案就在你面前。 ;)

在第一个代码中没有border =“0”

并且在第二个代码中有一个border =“0”

应用此css

  a img
    {
        border: 0;
        outline:0;(for removing dotted borders  from image and links.You gonna need this in future )
    }

或在第一段代码上应用border =“0”。

答案 2 :(得分:3)

只需在图片中设置border=0,就像在HTML中一样:

<img src="images/cal.gif" width="16" height="15" alt="" border="0" onclick="javascript:openCalWin('620','300','depositionsdatum')"></a>`

或CSS:

a img
{
    border: 0;
}

答案 3 :(得分:3)

这样就可以了:

a img {
   border: none;
}

答案 4 :(得分:2)

您将图像包装在一个锚点中,因此它是具有边框的链接。

a img { border:none; }

答案 5 :(得分:1)

<img />的默认边框为1px。在样式表中设置border: 0;或在border="0"标记内使用<img />内嵌。

答案 6 :(得分:1)

使用此css -

a img {border:none;outline:0;}

如果需要,也可以使用它 -

a:hover, a:active, a:focus {outline:0;}