Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2006, 03:07 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 2 Try It Out Example 2-4. Different results.

Help anyone! Am a newbie to CSS. Have found that implementing a website with just the info in the Beginning ASP.NET 2.0 book is not enough to make it professional looking.

Hence studying this CSS beginner's book.

However, am going crazy trying to get the very first Try It Out to work.

Below is my code, which is as close to the book as I can get it. I do not get the results as shown on page 39, Fig 2-8 and 2-9. Rather, I get the text that should display in the tables, simply listed. Same bad results whether I include or exclude the DTD quirks or standards-compliant mode.

See comments at bottom of source list below to see my results.

--------------------------------------------------------------
<!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 a <em>strange</em> and rather pleasant odor about it.
        </div>
    </body>
</html>
Below is what displays in my VWD Express Browser:
Note: VWD Express Browser works because it displays
the html from Exercise 2-1 just fine!
Anyway, get the same bad result on exercise 2-4/5 when I use IE6 directly.
---------------------------------------------------------------

Some content.

This div smells funny.
This div has a strange and rather pleasant odor about it.

---------------------------------------------------------------
-->

Thanks.

VictorVictor


 
Old March 24th, 2006, 05:19 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Whoa!!! Found the mistake and it is quite subtle.
When I first typed in the code, I used a word doc.
If you have some automatica formatting set for yourself as I do, Word will
change single quotes from what you type, into "smart" quotes.

When later I copied and pasted the word doc onto an html page, the smart
quotes came right along with the rest of it.

Below appears the code I pasted in, within the comment block. Below it you can
see the same statement, but as I later typed it in. If you look careful, you
can see the very slight difference between smart quotes and (I guess) the not
so smart quotes. Wow. Who woulda thunk?

        <!--
        <style type='text/css' media = ‘all’>
        -->
        <style type='text/css' media='all'>

You can also see the bad quotes in my original listing.

 
Old March 24th, 2006, 05:29 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Still more funny business with single quotes.

Reading my own (second in the chain) reply to myself, I see that the quotes
were changed again! The subtle change I mention is not visible on my reply
to myself.

Rest assured that one needs to be careful about quotes when keying in specs
especially when converting from one kind of doc to another.

VV

 
Old March 27th, 2006, 09:08 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi Victor,

Word is a terrible, terrible application to use for composing HTML, CSS, etc source files.

Early on in Chapter 2 I recommended a few editors that are built for making these source files.

If you *must* use Word, you can turn off smart quotes and other auto correction features via one of the options menus. I'm on a Mac right now so I don't have Windows Word here and I'm not sure exactly where that's located.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old March 27th, 2006, 10:56 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Rich:

First off. Pats on the back to you for monitoring this forum. I notice that you dispense corrective comments here with a very high percentage rate. Pat, Pat, Pat.

You are right about MS Word being a poor choice and I don't normally use it. My tool of choice is VWD Express 2005. It has provision for not only dragging and dropping a CSS sheet onto a webpage, but one can easily add a CSS webpage to a website development project (using VWD) with one click. Pretty nice.

I didn't plan on studying CSS until needed in connection with webpage development. To my surprise, I found, right off the bat, that simply assimilating the material in the ASP.NET 2.0 and selected topics in the advanced version of that book were not nearly enough to allow me to proceed with a professional application -- that CSS was absolutely essential for speed and not having to type, over and over the same style specs.

I am developing two differnt websites for my clients and squeeze time in to proceed into your book. When I run into a presentation jam, I divert to your book and frequently find a work around or fix.

Do you plan, or is there already, an *advanced* CSS book?

VV


 
Old March 27th, 2006, 12:12 PM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

Victor:
Other "advanced" book recommendation answers.
Rich has a new "CSS Instant Results" publishing next month:
http://www.wrox.com/WileyCDA/WroxTit...47175126X.html
It's 10 example applications that you can use and modify.

Another "advanced" book you might look at is Professional CSS:
http://www.wrox.com/WileyCDA/WroxTit...764588338.html
It looks at several major sites designed by well-known CSS designers and the techniques used to build those site.

Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Jim's Book of the week: No book this week - Donate to the Red Cross!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
display results carswelljr ASP.NET 2.0 Basics 1 April 19th, 2007 09:46 AM
Ch. 4 & Ch. 12 athena BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 23rd, 2004 10:54 AM
Isolation of results CFerthorney Beginning PHP 5 February 23rd, 2004 09:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.