Skip to content Skip to sidebar Skip to footer

Wrapper Layout And Div Problems

Image I tried this with the following CSS and HTML. It looks fine when the browser is of full width and scrambled when browser is resized. I WANT the elements to be where there a

Solution 1:

If you want to align you object in the center, there are a couple of different ways. First of all, there is the text-align:center; which you don't need right now. There is also object-position:center; which basically does the same, but with an object. This way isn't the best, but you could add a certain percentage of padding to either side but that's not recommended. Lastly, there's alignment-adjust:central;. This may not be perfect for your situation but just try out all of these and see if they work. Good luck!

Solution 2:

One way that would work is to set your wrapper width to a fixed value (something in 800px for example). As long as this width was longer than all the content you are putting within that wrapper, everything should work as you want. The browser will automatically place a horizontal scroll bar when the window gets smaller than the width of the wrapper.

Solution 3:

This is just a small error I found in the CSS and I don't know if this will help too much. The div you added was not referred to as a div, but a class. For example, if you wanted to style a div in CSS, you would do this:

#divname {
CSSfordivgoeshere...
}

On the other hand, if you wanted to add a little style to a class, you would go like this:

.classname {
CSS forclassgoes here...
}

If you were wondering what the difference for each is, the answer is simple. A class can define multiple objects while the divs are just limited to one object or element.

Post a Comment for "Wrapper Layout And Div Problems"