Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

09 May 2011

[web_design] Did The Lakers Get Swept? Simple Website - Effective CSS Lesson

2620.I don't know if Brad Benites was out to teach web design, but he did.

Brad Benites is a resident of Arizona who's also a DMavs fan. In other words, he's also thrilled that the Mavericks ate the Lakers lunch, but whereas my joy is based on schadenfreude and despair, his is based on his team actually winning the series, an alternative I hope the Blazers explore in future seasons.

Proving it's impossible to predict what will go viral (believe me, I wish I knew that magic bullet (Magic and Bullet being two other NBA squads entirely)) He asked the question "Did the Mavericks Sweep The Lakers" with the website http://didthelakersgetswept.com/.

Go ahead and click the link. Even dialup users can do this one.

Are you back? Good. Since web design intrigues, I ordered up a source view, and wasn't surprised to find out that it included very little: What you see is what you got, except for the visitor tracking javascript. However … the simplicity of the design provided a straight-ahead look at some thoroughly modern web design. Here's what it was:

Of course, first, there was some header information. It's what you might expect. Then, came this bit of text:

<style type="text/css">

.yes {
    font-family:Arial, sans-serif;
    color:black;
    font-size:7.0em;
    text-align:center;
    padding-top:200px;
}

This is just basic CSS. Since it's in the file itself, it's inline CSS. Specifies font family, color, font size in ems, aligns in the center, and gives 200 pixels top and bottom padding. Good old box-model CSS.

The body (skipping the javascript) looks like this:

</head>
<body>
<div class="yes">Yes.</div>
</body>
</html>

The logic used makes it obvious to even the beginner here.

The first block, which defines the display of the characters, is a class selector. What identifies that, of course, is the period in front of the work "yes". Class selectors, of course, can be used wherever, on single things, large groups of things. The other thing is the ID selector, which is used to style only one element at a time. Each has their strengths. And this could have been styled with either an ID or a class selector, but class seems to be the right way to go here; the most simple approach, as demonstrated by the fact that all you have to do is insert the attribute in the div tag, and the job is done.

This is why CSS is so powerful. All you have to do is change one attribute in the selector definition, and the body text changes automatically. The box model makes positioning the text oh, so very easy - and so browser agnostic, you don't need to care (at least with this application) whether you're going to use Firefox, Opera, Safari, or Chrome to view it.

Moreover, a small task like this is ideal for inline CSS, which is typically eschewed in favor of external CSS. That's not to say that external CSS couldn't be used here: that selector could go into a file of its own, say yes.css,  and be attached to the file with the tag

<link rel="stylesheet" type="text/css" href="yes.css" />

It would be rather too much design for this little gem, but it would be utterly valid.

In the meantime … the Lakers are out! Swept by the Mavs! Go Mavs!

08 June 2010

[web design] CSS Button Maker - Create CSS 3 Web Page Buttons With Live Preview!

2430.
CSS 3 is making a lot of things possible that I didn't think would ever be possible via mere Cascading Style Sheets, and this demo (from CSSTricks) shows how you can style buttons, complete with hover effects (which is something I do know a little about and used just recently), rounded corners, gradients, and everything.

Finally & nifty web buttons without having to have a graphics utilty (not that I'm suggesting anyone give up thier Photoshop, of course).



The sliders allow you alter the vertical and horizontal size and the corner radius. The various color bars bring up a familiar-looking color picker that allows you to determine the color of the element, each controlling the gradients, hover colors, active colors, &c. the little drop-down allows you choose between three web-standard fonts.

And here's the best thing about it: not only is that a live preview, you click the button - and get the CSS you need to implement it.

The CSS3 Button Maker is available here: http://css-tricks.com/examples/ButtonMaker/#, or click upon the pic above. Happy button-making!

Thanks to Smashing Magazine for pointing me this direction.

Technorati Tags: , , ,

Powered by ScribeFire.

02 March 2010

[web design] So, Who Says I Have No Impact? My Blog Postings Get Used In Web Design Classes.

2333.
I haven't gotten a great deal of feedback from a lot of my web writing. It's a happy thing when I do.

So you can imagine that, a few days ago, my day was brightened considerably when a couple of older artcles over at Designorati were referenced by this blog posting, which belongs to a college level art course called ART 1359: Design for the web. It's completely obscured as far as which college it does belong to, but plugging the class name and title and the words "Cedar Valley" gleaned from the text indicates that the Dallas (TX) County Community College District teaches such a class.



The articles regard the difference between internal and external CSS files and what exactly the "Cascade" in CSS is and what it means. They must have been pretty acceptable if a design instructor decided to offer them up as reading via the class's blog, and remember that feeling I've talked about betimes, when you find that something you blogged about wound up answering a question someone had that you never knew would be asked? Got that feeling here.

So, hey, I was happy to offer it up for the common weal. I'm glad it seen as useful, and how many of you have had your blog articles used as fodder for classroom instruction?

So, see? Pretty nifty!

Technorati Tags: , , , , ,