TAILIEUCHUNG - The CSS Anthology: 101 Essential Tips, Tricks & Hacks- P17

The CSS Anthology: 101 Essential Tips, Tricks & Hacks- P17:Apart from writing books like this one, I write code. I make my living by building web sites and applications as, I’m sure, many readers of this book do. I use CSS to complete jobs every day, and I know what it’s like to struggle to make CSS work when the project needs to be finished the next morning. | CSS Positioning and Layout 297 Here s the code for this page chapter09 DOCTYPE html PUBLIC - W3C DTD XHTML Strict EN http TR xhtml1 DTD html xmlns http 1999 xhtml lang en-US head title Float title meta http-equiv content-type content text html charset utf-8 style type text css .featureimg float left width 319px style head body h1 Chinese-style stuffed peppers h1 img src width 319 height 213 alt peppers class featureimg p These stuffed peppers are lovely as a starter or as a . p More paragraphs body html Discussion The float property takes the element out of the document flow and floats it against the edge of the block-level element that contains it. Other block-level elements will then ignore the floated element and render as if it s absent. Inline elements such as content however will make space for the floated element which is why we can use float to cause our text to wrap around an image. As we can see clearly in Figure the text bumps right up against the side of the image. If we add a border to that image the text will collide against the side of the border. Download at 298 The CSS Anthology To create space between our image and the text we need to add a margin to the image. Since the image is aligned against the left-hand margin we only need to add right and bottom margins to move the text away from the image slightly chapter09 excerpt .featureimage float left width 319px border 2px solid 000000 margin-right 20px margin-bottom 6px Figure shows the resulting display with extra space around the floated image. Chinese style stuffed peppers These stuffed peppers are lovely as a starter or as a side dish for a Chinese meal. They also go down well as part of a buffet and even children seem to like them. Heat the oil in a wok. Add the garlic and stir fry until golden. Reduce the heat down and then add the ginger and the mince. Stir fry until this is nicely browned .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.