English 中文(简体)
CSS:通过确定遗嘱而改变联系方式
原标题:CSS: width of a link doesn t change by setting the width attribute
  • 时间:2011-06-29 14:59:08
  •  标签:
  • css

我有这样的建筑:

<a onclick="toggle_media_box(); return false;" href="#" class="media_link">
  <div id="media_link" class="media_link"></div>
</a><br />

#media_link {
  background-image: url("/images/media.png");
}

.media_link {
  width: 445px;
  height: 200px;
}

照片为445px(但为620px)。 与此等所有其他联系的面积为620px。

在独立实体中,所有工作都是细致的,联系规模为445px。 但是,在欧恩和 Chrome之间,联系仍然广泛存在620px。 div 拥有445px的适当规模。

什么? <代码><a> tag必须大小为445px。

有趣的是,该连接点的面积高达445px,但可点到620px。

页: 1

最佳回答

然后,<a> tag是线性元素。 因此,其宽度由标的内文本长度决定。 添加<代码> 显示:block;至

问题回答

http://www.un.org/Depts/DGACM/index_french.htm

.media_link {
    display: inline-block
}

您使用<代码>}=“媒体_link”2倍,#media_link,令人困惑。 无需使用<代码><br />——你可将其替换为<代码>的显示:栏目。

I recommend changing to this: http://jsfiddle.net/Yg4YN/2/

<a onclick="toggle_media_box(); return false;" href="#" class="media_link">
    <span class="media_span"></span>
</a>

.media_link, .media_span {
    display: block;
    width: 445px;
    height: 200px;
}
.media_span {
    background-image: url("/images/media.png");
}

Your HTML code is currently invalid and you should put the anchor <a> inside the <div> rather than the other way around.

您一旦通过右边的超文本,就可按要求将其定位为<条码>:24小时<<>代码>和大小。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签