如何相对于页面居中,而不是浮动图像 [英] How to centre relative to page, not floated image

查看:114
本文介绍了如何相对于页面居中,而不是浮动图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



页面:


< http://www.westmidlandbirdclub.com/club/logo.htm>


有一个标识浮动在左上角,另一个是浮动的。在顶部

右边,H1标题居中于它们之间(这个页面位于

页面)。

我只想将徽标左上方,但在页面上保留

标题的中心。


如何最好地实现?

-

Andy Mabbett

美国在关塔那摩湾监禁未经审判的儿童:

< http://news.bbc。 co.uk/1/hi/world/south_asia/2970279.stm>

< http://web.amnesty.org/library/Index/ENGAMR510582003?open& of = ENG-USA>


The page at:

<http://www.westmidlandbirdclub.com/club/logo.htm>

has a logo "floated" in the top left, and another "floated" in the top
right, with the H1 heading centred between them (and this centred on the
page).
I would like to only have the logo top left, but retain the centering of
the heading, on the page.

How is this best achieved?
--
Andy Mabbett
USA imprisons children without trial, at Guantanamo Bay:
<http://news.bbc.co.uk/1/hi/world/south_asia/2970279.stm>
<http://web.amnesty.org/library/Index/ENGAMR510582003?open&of=ENG-USA>

推荐答案

在文章< mz ************** @ pigsonthewing.org.uk>中,使用net200305

@ pigsonthewing.org.uk说...
In article <mz**************@pigsonthewing.org.uk>, usenet200305
@pigsonthewing.org.uk says...

页面位于:

< http://www.westmidlandbirdclub .com / club / logo.htm>

有一个标志浮动在左上角,另一个是浮动的。在顶部
右边,H1标题居中于它们之间(以
页面为中心)。

我想只在左上方标识,但保留页面上标题的中心。

如何最好地实现?

The page at:

<http://www.westmidlandbirdclub.com/club/logo.htm>

has a logo "floated" in the top left, and another "floated" in the top
right, with the H1 heading centred between them (and this centred on the
page).

I would like to only have the logo top left, but retain the centering of
the heading, on the page.

How is this best achieved?




我不知道关于''最好'',但如何将其设置为页面

background&修正h1高度以适应?


示例: http://porjes.haxorz.org/bird.html



I don''t know about ''best'', but how about setting it as the page
background & fix up the h1 height to suit?

Example: http://porjes.haxorz.org/bird.html


文章< mz ******* *******@pigsonthewing.org.uk>,

Andy Mabbett< us ********** @ pigsonthewing.org.uk>写道:
In article <mz**************@pigsonthewing.org.uk>,
Andy Mabbett <us**********@pigsonthewing.org.uk> wrote:
页面:

< http://www.westmidlandbirdclub.com/club/logo.htm>

有一个标志浮动在左上角,另一个是浮动的。在顶部
右边,H1标题居中于它们之间(以
页面为中心)。

我想只在左上方标识,但保留
标题的居中,在页面上。
The page at:

<http://www.westmidlandbirdclub.com/club/logo.htm>

has a logo "floated" in the top left, and another "floated" in the top
right, with the H1 heading centred between them (and this centred on the
page).
I would like to only have the logo top left, but retain the centering of
the heading, on the page.




如何将徽标绝对定位?或者甚至更好,因为你的H1中的文字已经传达了徽标不能做得更好的东西

(在文字上下文中):将徽标设置为背景图像H1;


h1 {text-align:center; background:url(" logo.gif")透明顶部

left no-repeat;颜色:#000; }


< h1>西米德兰鸟类俱乐部< / h1>


-

Kris
kr*******@xs4all.neth erlands(nl)

我们称他为乌龟因为他教我们 Mock Turtle说。



How about having the logo absolutely positioned? Or even better, since
the text in your H1 already conveys what the logo cannot do any better
(in a textual context): set the logo as a background image to the H1;

h1 { text-align: center; background: url("logo.gif") transparent top
left no-repeat; color: #000; }

<h1>West Midland Bird Club</h1>

--
Kris
kr*******@xs4all.netherlands (nl)
"We called him Tortoise because he taught us" said the Mock Turtle.


Andy Mabbett写道:
Andy Mabbett wrote:

< http://www.westmidlandbirdclub.com/club/ logo.htm>

有一个标志浮动在左上角,另一个是浮动的。在
右上角,H1标题位于它们之间(以页面为中心)。

我想只在左上方标识徽标,但保留



如何最好地实现?

<http://www.westmidlandbirdclub.com/club/logo.htm>

has a logo "floated" in the top left, and another "floated" in the
top right, with the H1 heading centred between them (and this
centred on the page).

I would like to only have the logo top left, but retain the
centering of the heading, on the page.

How is this best achieved?




float获取的项目正常的文件流,所以它不会影响h1上设置的边距。因此,


h1 {margin-left:auto; margin-right:auto}


像以前一样漂浮图片。


-

Brian

按照我的地址中的说明给我发电子邮件



float takes the item of the normal document flow, so it will not
affect margins set on the h1. Thus,

h1 {margin-left: auto; margin-right: auto}

float the image left as before.

--
Brian
follow the directions in my address to email me


这篇关于如何相对于页面居中,而不是浮动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆