09.06.2015 Views

learn_HTML

learn_HTML

learn_HTML

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LAYOUT<br />

The design looks bigger/smaller<br />

on some screens.<br />

The resolution of a monitor<br />

affects how big the items appear<br />

on the page. p 377, 378<br />

Margins above and below a box<br />

not showing.<br />

Vertical margins collapse. p 308<br />

My content does not fit in the<br />

containing box/browser window.<br />

You can deal with this using the<br />

overflow property. p 306, 316<br />

Boxes look a different size in IE.<br />

Some versions of IE use a<br />

different box model than all<br />

other browsers. Use a DOCTYPE<br />

declaration to make old versions<br />

of IE behave like other browsers.<br />

p 316<br />

Boxes do not appear centered<br />

when using auto for left and<br />

right margins.<br />

You may need to use the<br />

text-align property on the<br />

containing element. p 315<br />

Elements are overlapping.<br />

When you take elements out of<br />

normal flow, they can overlap.<br />

z-index helps you control which<br />

item goes on top. p 369<br />

Why is the vertical-align<br />

property not vertically centering<br />

my block-level element?<br />

This property is not designed for<br />

this purpose. It is used to center<br />

inline elements on the page.<br />

You will find several ways to<br />

vertically center block-level<br />

elements (depending on their<br />

context) if you search on Google.<br />

A background image is not<br />

showing on my box.<br />

Does the box you are applying<br />

the style to to have a defined<br />

height and width? p 303<br />

Does the containing box have an<br />

overflow property set to auto?<br />

p 373, 374<br />

My background images do not<br />

show when the page is printed.<br />

Most browsers do not print<br />

background images by default to<br />

help save ink. You can adjust this<br />

in your print preferences.<br />

There is a gap between the<br />

browser window and my<br />

content.<br />

You may need to set margin and<br />

padding on the element<br />

to 0. p 313, 314<br />

FLOAT IN LAYOUT<br />

A box is not sitting next to<br />

another floated element.<br />

Ensure that there is enough<br />

space in the containing element<br />

for the two to sit side by side.<br />

p 303<br />

Margins and padding are added<br />

to the width of the box (except<br />

for older versions of IE, which<br />

have a different box model).<br />

Therefore, the box might be<br />

wider than specified in the width<br />

property. p 316<br />

Did you specify a width for the<br />

floated element? (See next<br />

point.)<br />

My floated element takes up the<br />

full width of the browser window<br />

(or containing box).<br />

Check that you have specified<br />

a width for the floated element.<br />

p 371<br />

The container around my floated<br />

elements are one pixel tall.<br />

The containing element doesn't<br />

know the height of the floated<br />

elements inside it. You can<br />

either add an element that acts<br />

as a clearing box or use the<br />

overflow property with a value<br />

set to auto. p 373<br />

IE added an extra margin to my<br />

floated elements.<br />

Set the display property to<br />

inline.<br />

If you've come across a problem<br />

that you think belongs in this<br />

troubleshooting section, please<br />

feel welcome to email it to us at:<br />

hello@htmlandcssbook.com.<br />

We will endeavor to address<br />

the most common problems<br />

our readers have faced in future<br />

editions of this book. Thank you!<br />

INDEX

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!