English 中文(简体)
• 如何固定一个小页,以便在国际电子7中正确展示? (2)
原标题:How to fix a small page so it displays correctly in IE7? (2)

我删除了许多法典。 所需守则如下。 页: 1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML >
<HEAD>

</HEAD>
<BODY>
<DIV style="border:1px solid #000;">
    <SPAN style="MARGIN-LEFT:20px;">
        Previous
    </SPAN>
    <SPAN style="FLOAT:right; MARGIN-RIGHT:20px;">
        Next
    </SPAN> 
</DIV>
</BODY>
</HTML>

All I want is to display previous and next on the same line. It looks one below another in IE7, but OK in FF and Opera. Chrome was not tested yet. Also, when I remove <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">, then Opera displays that two words not in one line as well. All I want is to display the word "Previous" to the left and "Next" to the right within div and in one line.

What s the best way to fix it? Thank you.

最佳回答

奥凯,我目前还没有所有这些浏览器在我前面,但你有可能通过在第一段时期内增加<代码>float:左

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML >
<HEAD>
</HEAD>
<BODY>
<DIV style="border:1px solid #000; overflow: hidden; width: 100%;">
    <SPAN style="clear: left; FLOAT:left; MARGIN-LEFT:20px;">
        Previous
    </SPAN>
    <SPAN style="clear: right; FLOAT:right; MARGIN-RIGHT:20px;">
        Next
    </SPAN> 
</DIV>
</BODY>
</HTML>

Not that we have set a width and overflow value on the containing div. The clear value is not important in most use cases. You can use different width and overflow values (for example, 50% and auto) as appropriate.

欲了解更多信息,并补充一些 t,请见。 如果我有一份IE7版的复印件,我将对你进行测试,但你应当关闭。

该条:

The use of a width or height declaration is required to make the effect work in Explorer Windows and Opera. If you don t include it Explorer Windows continues to show the border at the top of the columns, as if there were no overflow. Opera completely hides the content of the container.

问题回答

暂无回答




相关问题
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....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

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 ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签