Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Add Width to Website?

I posted this earlier but I needed to add a few things, plus no responses. Anyways, I have a header which is 1025 wide. The body of my website(template) is in 3 different sections, 2 side columns for adds and links and a main section in the middle, however I want it all to stretch as wide as the 1025 header, which right now it is not! Here are examples of the sections I have:

<div id="content">

<div id="colOne">

<h2>Las Vegas Guide</h2>

<ul>

<P ALIGN="LEFT"><a href="http://dg.ian.com/index.jsp?action=viewLocation&ci... VEGAS CITY GUIDE</a><p>

<P ALIGN="LEFT"><a href="#">LAS VEGAS TIPS</a><p>

<P ALIGN="LEFT"><a href="#">LAS VEGAS HOTEL GUIDE</a><p>

<P ALIGN="LEFT">

<P ALIGN="LEFT"><a href="#">MORE</a><p>

</ul>

<h2></h2>

<ul>

There is more data, but pretty much each section is layed out like that. Thoughts?

2 Answers

Relevance
  • 1 decade ago
    Favourite answer

    Check the style sheet for:

    #content {

    There may be a width associated with it. It needs to be set to the width you are looking for, assuming the DIV container is the outer most element.

    width: 1025px;

    But you need to be mindful of any additions to the width, such as padding, margins, and borders.

  • Tikken
    Lv 6
    1 decade ago

    Your layout is using uppercase letters mixed with lowercase letters, this in itself is not a fetal mistake, but pointless.

    There is no attribute called "align", and your usage of ul elements is invalid. The below example would be the correct way to use ul.

    -----StartCode-----

    <ul>

    <li><a href="http://www.brugbart.com/%22%3EExample Link</a></li>

    <li><a href="http://www.brugbart.com/%22%3EExample Link</a></li>

    </ul>

    -----CodeEnd-----

    Also note that it makes no sense to start by using h2, before h1. It would be more appropriate to use h1 for the main headline, h2 for section headlines, and h3 for subsections. ETC.

    http://www.brugbart.com/References/96/ - The OL, UL and LI Tags

    You don't inform us what 1024 is, it can basicly be pixels, ems, or percentages ETC. Since you say its exactly 1024 wide, i presume that you mean pixels, since that is a common value to be defined in pixels.

    I would again request that you simply cut the header element inside the content division, and apply "width: 100%;" to the header, and then "width:1024px;" to the content division, i do also suggest you do it through id selectors, or through the use of inline styles.

    http://www.brugbart.com/References/117/#Sec13 - Id Selectors

    http://www.brugbart.com/References/6/#Sec1#Sec1 - Inline Styles

    Each column would need a width of 341px, this would equal 1023, and leave a single pixel differance. To solve this problem, you will need to float the right column (presumably colThree in your case) to the right, while the colOne and (presumably the colTwo) columns will be flooted left, this may again create other browser specific problems.

    These may again be solved if you create a LeftCenterWrap for the colOne and the presumed colTwo column, which would leave us with the following, one Basment which is centered using "margin: o auto;" which is parent of LeftCenterWrap and the presumed colTwo. where LeftCenterWrap is flooted left, and the presumed colTwo is flooted right. Finally we have the children of LeftCenterWrap, colOne is floated left, and colTwo is flooted right.

    Another problem is working with padding, this is where many webdesigners chose to create yet another wrapper, usually just a ContentBox with a smaller width (around 98%) then the actual CenterContent, and its alignment set to "center" by the use of "margin: 0 auto;", or they may simply apply margin to the children of the CenterContent.

    Also note that there is no attribute called align, you are encouraged to use the css text-align property instead, and you may want to use it togetter with "margin: 0 auto;" when centering a page, since the correct way to center a page would be to apply "margin: 0 auto;", ealier versions of IE however only supports the text-align property.

    http://www.brugbart.com/References/49/ - text-align

Still have questions? Get answers by asking now.