Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3
This is the forum to discuss the Wrox book Beginning CSS: Cascading Style Sheets for Web Design by Richard York; ISBN: 9780764576423
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 29th, 2007, 10:41 PM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 2 Figure 2-9

Hello:

First, let me congratulate Richard York for the great book. Iím trying hard to not buy the other book (that seems more advanced, because the comments) until not finish this satisfactorily.

Seems than nobody have the same problem because I check, at glace, in the forum and nobody asked for the same.

 I canít make IE 7, Mozilla Firefox, or Opera 2 behave like the example in figure 2-9.

The same code, without the Strict XHTML DOCTYPE (quirk mode), behave like figure 2-8 in IE7.

What happened (the output) in standard mode is that the table goes centralized above the div element, and the div elements, in two rows (not by side: div1 width: 30%; and div2 margin-left: 34%; width: auto;), occupied all the windows width one (div1) over the other (div2).

I recheck my code and try different things but canít make the browsers behave like Figure 2-9. So I will appreciate any help.

The code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html>

   <head>
       <title>Doctype Sniffing</title>

    <style type='text/css' media='all'>

        table {
            margin: auto;

              }

        td {
            background: green;
                margin: 10%;
            border: 5px solid black;
            padding: 10%;
            width: 100%;
            color: black;
            font-size: 200%;
            text-align: center;
            }

        div {
            background: green;
            border: 5px solid black;
            font-size: 200%;
            padding: 1%;



        #div1 {
            float: left;
            width: 30%;
              }

        #div2 {
            margin-left: 34%%;
            width: auto%;
              }

    </style>

   </head>

   <body>

    <table>
        <tr>
            <td>
               Some content.
            </td>

        </tr>
    </table>

    <div id='div1'>
       This div smells funny.
    </div>

    <div id='div2'>
       This div has <em>strange</em> and rather pleasing odor about it.
    </div>

   </body>

</html>

Reply With Quote
  #2 (permalink)  
Old April 30th, 2007, 03:02 PM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry but Iam getting blind. When checked the code again saw extra % signs in the #div2 element. When fixed, the code doesnít change. Then I see that I forget the closing bracket, }, in the div selector of the CSS. When fixed the browser look like figure 2-9.

Reply With Quote
  #3 (permalink)  
Old April 30th, 2007, 03:36 PM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excuse my English. Practice makes the proficiency. I expect improve for the next chapters.

I have another (hopes that better) question.

Mozilla Firefox and Opera interpret the styles differently. Firefox break the Some content, in the table. Some, going above, and content below. Opera, on the contrary, make a lot of padding (for the same 10% for the table and 1% for the divs elements), pushing the borders, and render a very big (in comparison) table.

Who is, more correct, for the standard (W3C) compliant point of view?

Thanks,
Mark


Reply With Quote
  #4 (permalink)  
Old April 30th, 2007, 04:15 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

The quirks mode / standards mode differences demonstrated in that figure only occur in IE6.

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design, 2nd Edition
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote
  #5 (permalink)  
Old May 1st, 2007, 10:39 AM
Registered User
 
Join Date: Apr 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Richard:

I know that Iím only in chapter 2 (now in Chapter 3) But I wish to know (if you think is convenient at this stage), why the differences in Firefox (that split Some content in the table element) and Opera (big table)? Also I want to know if you have ebook of this great book or your other books.

Thanks for your help,
Mark


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't figure this out. aaronmuslim XSLT 4 March 20th, 2008 11:13 AM
the Figure 1-3 confused me EdwardChou BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 May 12th, 2007 05:48 PM
Help! - Can't Figure Out FaxCOMEXLib hugh@kmcnetwork.com VB How-To 0 May 10th, 2005 09:13 PM



All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.