Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Styling user feedback

From: Dreamweaver CS4 with CSS Essential Training

Video: Styling user feedback

You may have noticed that the email label is looking a bit crowded, and visually confusing. You can see here we have Email: email is required, butting right up against it. The placement of the required statement is actually driven by screen readers and other user agents. Based on its current placement, a screen reader would indicate that the content is required, before the user gets a chance to skip it. From usability standpoint that's ideal. From a visual standpoint, not so much. So with some creative class usage and positioning however, we can have the best of both worlds.

Styling user feedback

You may have noticed that the email label is looking a bit crowded, and visually confusing. You can see here we have Email: email is required, butting right up against it. The placement of the required statement is actually driven by screen readers and other user agents. Based on its current placement, a screen reader would indicate that the content is required, before the user gets a chance to skip it. From usability standpoint that's ideal. From a visual standpoint, not so much. So with some creative class usage and positioning however, we can have the best of both worlds.

So we have the 08_05 opened up, and we are going to go ahead and address this form valuation section. So one of the things that we can take advantage of here is positioning, and again, discuss positioning in a lot more detail in the chapter on layout. But just so you'll kind of have an idea of what we are doing here. The Email, and email required are both in the same label. Email is required is in a span tag that surrounds it. And both of these are surrounded by a paragraph tag. You can think of that paragraph tag as their parent element, because that is exactly what it is.

We can put a positioning attribute on that parent element, so that the element inside of it can move around relative to it, rather than any other element, and that's exactly what we are going to do with our first selector. So for this I'm going to hand code it, and again and one of the easiest way is to jump down to these styles, is to simply hold the Alt key down or the Command+Option key on the Mac and click. That brings up your Code Navigator, and if you find a form style that you can click on it, and it will jump you right to your Form Styles in your code, which is awesome. I am going to scroll down and find my last form style, and then we are going to just code this a little bit below that one.

So I'm going to type in p.required. So we are going to do a paragraph style with the class required applied to it. And this is going to be extremely simple, we are just going to do position:relative. So again, position:relative keeps it within normal document flow, but it gives it that positioning attribute, so that everything else inside of it will now position itself relative to this paragraph. So I'm going to switch back over to the design portion of my Split view. I can now select that paragraph using the tag selector, and using the properties inspector, grab that pull- down menu and choose required.

Thing's changed a little bit here in Dreamweaver. Don't worry. Dreamweaver is just having a little issue rendering this. It's not going to render incorrectly in the browser. It's only happening here in Dreamweaver. It's nothing to be concerned about. Okay, let's go back over into our CSS code, and I'm going to type in span.required. Now you are seeing one of the advantages of actually using the element specific class or id selectors. I can use the required class multiple times and have it style differently based on whether it's applied to a paragraph or span tag, so pretty cool. So I'm going to go in the next line here, and I'm going to type in position:absolute.

Now unlike relative positioning, absolute positioning removes it from normal document flow. But now based upon the offset we give it, how far we move it over or down or up, it's going to move relative to the top left hand corner of its parent element, which is the paragraph. So that's why we put the relative positioning on the paragraph to begin with, okay. Now I'm going to type in left 320 pixel, and then we are going to do a padding left. So padding-left of 35 pixels. Now what are both things doing for us? Well, first off left it's going to push it actually over to the right.

So it gives it a left offset, positive values are going to move it to the right hand side. What this is going to do is this is going to move it away from the word email, and move it to the right of the text field. I would love to tell you, I was able to calculate that value precisely, and to a certain extent I did, but just like anything else, you are going to fiddle around with it and try some numbers until you get it actually where you want it. Now the padding left is because we want to style this a little bit more visually. So we are going to add a background graphic to it as well. I'll hit Return, and we need to go ahead and add that. So I'm going to type in background. Remember if you are using code heading, you can type in a u, it will jump down to URL, and when you hit Return, it will let you browse for that image.

So even if your are hand coding, you can still use code heading to help you do things like this, where you browsing on finding things. So we are going to the 08_05 directory_ images, and we are going to go and find the notice_icon.gif. So notice_icon.gif, let's do a little scroll, and he is exactly 30 pixels wide, and that's why we have the 35 pixel left padding. I'm going to go ahead and click OK, and it's going to add that to my code. Now I'm going to do a no-repeat, and then we are going to position that left for horizontal, and then center for vertical, and that way it will center it vertically on our text.

Now I'm going to hit Return to go down the next line, and we can do some color here, and our Color is going to #c00 which is a red, and then on the next line, we are going to height. Now, why are we having to define a height for this. The height is going to be 25 pixels. Well, we are thinking about our image. We want to make sure the span tag is tall enough to display that background image, and that's why we are forcing a height. We are also going to do a line-height of 25 pixels, and that line-height is going to center the text inside that area. So the background will be centered to it, the text will be centered to it, they'll all be centered within those 25 pixels.

I'm going to go ahead and save that and switch back to Design view, because one of the things we are going to need to here is click inside that emails required, find the span tag on your tag selector, and use the properties inspector to grab the pull-down menu and choose required. It may look like it actually has it, and in fact, it didn't apply it. Now why not? It didn't apply it, because it was already applied to that paragraph. As a matter of fact, notice that it removed the span tag. There are some things that work great in Design view, and there are some things that don't. So now what I'm going to do is highlight this text, and do a Ctrl+T. Notice that now I prompt to drag the tag and I'm going to wrap it in a span tag and give it a class required.

So there are some things that just work better hand coding. So now I'm going to do Save All, preview that in my browser, and cool, we are getting exactly the styling we want on that. That is fantastic. Our form layout and styling are now pretty much complete. Now we could leave the form the way it is. But improving the user experience is something that you should always be looking to accomplish. So what we are going to do next is add a little bit of user interaction to our form to enhance its usability.

Show transcript

This video is part of

Image for Dreamweaver CS4 with CSS Essential Training
Dreamweaver CS4 with CSS Essential Training

120 video lessons · 41512 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 7m 50s
    1. Welcome
      1m 18s
    2. Do I need to know CSS to use Dreamweaver?
      2m 15s
    3. Using the exercise files
      1m 30s
    4. Setting up a custom workspace
      2m 47s
  2. 1h 2m
    1. Separating structure from presentation
      4m 14s
    2. Adding meaning with ID and class attributes
      7m 50s
    3. Understanding basic selectors
      11m 10s
    4. Understanding complex selectors
      11m 21s
    5. Examining the Cascade
      10m 16s
    6. Understanding order of inheritance
      5m 2s
    7. Understanding specificity
      5m 43s
    8. Using Dreamweaver to resolve conflicts
      7m 4s
  3. 52m 48s
    1. Working with starter pages
      2m 1s
    2. Defining fixed, elastic, liquid, and hybrid
      6m 3s
    3. Understanding starter page structures
      6m 25s
    4. Modifying CSS globally
      8m 58s
    5. Moving CSS between files
      12m 31s
    6. Preparing custom starter pages
      10m 9s
    7. Creating custom starter pages
      6m 41s
  4. 1h 25m
    1. Designing with CSS in mind
      3m 13s
    2. Using Fireworks to create site prototypes
      2m 41s
    3. Defining page structure
      8m 52s
    4. Creating the initial layout
      10m 24s
    5. Page creation and asset sharing
      11m 20s
    6. Using common libraries to create site prototypes
      5m 11s
    7. Building interactive prototypes
      17m 6s
    8. Optimizing images in Fireworks
      11m 47s
    9. Exporting web graphics from Fireworks CS4
      2m 43s
    10. Exporting interactive prototypes
      3m 11s
    11. When to export XHTML and CSS from Fireworks CS4
      8m 34s
  5. 48m 28s
    1. CSS workflows in Dreamweaver
      1m 17s
    2. Using the CSS Styles panel
      5m 12s
    3. Setting CSS preferences
      9m 50s
    4. Understanding Dreamweaver's CSS visual aides
      3m 50s
    5. The Code Navigator
      6m 5s
    6. Controlling CSS with the Properties Inspector
      8m 52s
    7. Using Related Files
      4m 35s
    8. Working with Live view
      4m 12s
    9. Working with the Reference panel
      4m 35s
  6. 1h 13m
    1. Declaring font families
      4m 57s
    2. Creating custom font family declarations in Dreamweaver
      6m 0s
    3. Understanding units of measurement
      6m 14s
    4. Controlling font sizing
      8m 41s
    5. Controlling line spacing
      7m 20s
    6. Controlling vertical margins
      7m 52s
    7. Horizontally aligning text
      3m 16s
    8. Vertically aligning text
      5m 30s
    9. Vertically centering block-level elements
      10m 31s
    10. Setting column width
      3m 33s
    11. Using font shorthand notation
      9m 15s
  7. 1h 10m
    1. Background properties
      4m 33s
    2. Using background images
      5m 16s
    3. Controlling background image tiling
      5m 33s
    4. Positioning background images
      4m 42s
    5. Using percentage values for positioning
      5m 10s
    6. Creating custom list bullets
      5m 23s
    7. CSS drop shadows
      7m 40s
    8. Image replacement techniques
      7m 24s
    9. Adding screen-only content
      7m 51s
    10. Complex background graphics
      9m 10s
    11. Using CSS Sprites
      8m 0s
  8. 38m 48s
    1. Reviewing table tag structure
      4m 48s
    2. Using thead and tbody for styling
      5m 45s
    3. Styling table captions
      4m 30s
    4. Styling headers
      8m 29s
    5. Styling table content
      4m 18s
    6. Creating alternating row colors
      3m 29s
    7. Using pseudo-class selectors for tables
      2m 27s
    8. Creating custom table borders
      5m 2s
  9. 43m 37s
    1. Examining form structure
      3m 26s
    2. Styling fieldset and legend elements
      7m 42s
    3. Styling form elements globally
      6m 31s
    4. Using classes to identify form elements
      5m 55s
    5. Styling user feedback
      6m 10s
    6. Adding user interaction
      2m 52s
    7. Styling Spry form validation fields
      11m 1s
  10. 44m 48s
    1. Using lists for navigation
      1m 40s
    2. Creating horizontal menus pt. 1: Stripping list styling
      3m 28s
    3. Creating horizontal menus pt. 2: Displaying links horizontally
      3m 54s
    4. Creating horizontal menus pt. 3: Styling links
      5m 25s
    5. Creating horizontal menus pt. 4: Rollovers
      3m 48s
    6. Creating horizontal menus pt. 5: Indicating current page
      3m 48s
    7. Creating horizontal menus pt. 6: Modifying cursor usage
      2m 11s
    8. Creating horizontal menus pt. 7: Positioning menus
      3m 8s
    9. Styling vertical menus pt. 1: Vertical menu considerations
      6m 42s
    10. Styling vertical menus pt. 2: Defining width for link elements
      4m 46s
    11. Styling vertical menus pt. 3: Using background graphics with navigation
      5m 58s
  11. 1h 40m
    1. Box model review
      7m 4s
    2. Understanding margin collapse
      7m 15s
    3. Reviewing normal document flow
      11m 0s
    4. Understanding floating
      8m 56s
    5. Containing and clearing floats
      9m 26s
    6. Understanding relative positioning
      5m 30s
    7. Understanding absolute positioning
      5m 29s
    8. Understanding the AP Elements panel
      11m 57s
    9. Understanding fixed positioning
      2m 24s
    10. Using Dreamweaver to define document structure
      10m 11s
    11. Creating a two-column layout
      17m 1s
    12. Using Dreamweaver's Design-Time style sheets
      3m 49s
  12. 28m 59s
    1. Introducing Spry widgets
      2m 18s
    2. Updating the Spry framework
      45s
    3. Examining the default Spry styles
      6m 36s
    4. Modifying tabbed panels through CSS
      5m 18s
    5. Styling Spry widgets
      8m 49s
    6. Organizing Spry style sheets
      5m 13s
  13. 34m 49s
    1. Creating print style sheets
      2m 57s
    2. Assigning media types
      3m 29s
    3. Styling type for print
      9m 21s
    4. Suppressing element printing
      3m 29s
    5. Controlling page breaks
      8m 39s
    6. Using @media blocks
      3m 5s
    7. Creating alternative style sheets
      3m 49s
  14. 35m 22s
    1. Using Dreamweaver's Browser Compatibility Check
      3m 58s
    2. Fixing code errors with Adobe's CSS Advisor
      4m 45s
    3. Strategies for browser compatibility
      5m 8s
    4. Implementing browser compatibility
      8m 18s
    5. Formatting code for deployment
      3m 15s
    6. Creating modular style sheets
      3m 38s
    7. Assembling modular style sheets
      6m 20s
  15. 38s
    1. Goodbye
      38s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver CS4 with CSS Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.