简体   繁体   English

填满屏幕宽度

[英]Filling a screen width

I'm really struggling to tidy up a web site I am building for someone. 我真的很努力整理自己正在为某人建立的网站。 I've spent hours on trying to figure this out! 我已经花了数小时试图找出答案! I have limited knowledge so the code would be helpful. 我的知识有限,因此代码将对您有所帮助。 They want the section at the top (originally two images, now I'm trying background images and css) to fill the width of the browser- no matter what size it is. 他们希望顶部的区域(本来是两张图像,现在我正在尝试背景图像和CSS)填充浏览器的宽度-无论其大小如何。 Does anyone know how to do this? 有谁知道如何做到这一点?

Similarly, is there a setting to get text to fill 100% width of the box, no matter what? 同样,是否有一种设置使文本填充框的100%宽度,无论如何?

I would seriously appreciate even someone helping me move on a step! 我什至会非常感激甚至有人帮助我迈出一步! they want everything to sit tight and inline, in some browsers/screens it does but on mine it spreads out with lots of white space. 他们希望所有内容都紧凑,内联,在某些浏览器/屏幕中确实如此,但在我看来,它会散布很多空白。

www.thegees.co.uk is the site. 网站是www.thegees.co.uk

I don't know what you mean by "text", and I'm not sure whether this will help you but any block level container will have 100% width by default: 我不知道您所说的“文本”是什么意思,我不确定这是否对您有帮助,但是默认情况下,任何块级容器的宽度都是100%:

<div style="background-color: red">I'm 100% wide!</div>

If you have a span that won't stretch to 100%, put a div around it and whatever background properties the span has, give the div instead. 如果span不能延伸到100%,请在其周围放置一个div ,并选择该跨度具有的任何背景属性,而改为使用div

<div style="background-image: ....">
 <span>
   I'm not 100% wide, but the div around me is, 
   so no one will notice the difference!
 </span>
</div>

Remove the "width" definition from these two tags: 从以下两个标记中删除“宽度”定义:

< TD width="48%">...< /TD> < TD width="52%">...< /TD> <TD width =“ 48%”> ... </ TD> <TD width =“ 52%”> ... </ TD>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM