Announcement Announcement Module
Collapse
No announcement yet.
CSS Positioning Question Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Featured Images Featured Images Module
Collapse

Mediabistro Creative Sites Mediabistro Creative Sites Module
Collapse
Latest Topics Latest Topics Module
Collapse

  • Lucifer
    Reply to InDesign and Illustrator - am I missing out?
    Lucifer
    That's interesting. I assume you live in America, B. I'm from India, and I've been to four different printers in the past year. All of them use CorelDRAW. Perhaps it's because CD is cheaper than the Adobe...
    Today, 08:59 AM
  • B
    Reply to InDesign and Illustrator - am I missing out?
    B
    This is going to sound like I live in a cave by myself and never venture into the sunshine, but in my 30-plus years of working in this field, I've never personally encountered anyone who uses CorelDRAW,...
    Today, 06:31 AM
  • Lucifer
    Reply to InDesign and Illustrator - am I missing out?
    Lucifer
    Thanks, Buda. So far I've used it to create a logo, business cards and various hotel menus. Everything gets done so much faster (I used to be a hardcore Photoshop guy). I'm going to get started with...
    Today, 04:55 AM
  • EmberMike
    Reply to Is 9-to-5 a thing of the past?
    EmberMike
    My impression has been that people eat at their desks because there is too much work to be done. I put in 9.5 hours today at my desk, and most other people were there just as long or longer. Luckily for...
    Today, 04:38 AM
  • Buda
    Reply to InDesign and Illustrator - am I missing out?
    Buda
    I haven't used CorelDRAW in over 10 years and I can't remember the last time someone brought a CorelDRAW file in. CorelDRAW is not an alternative for the entire Adobe Suite.

    I'm basing this...
    Today, 03:58 AM
Advertisement Advertisement Module
Collapse

Sponsors Sponsors Module
Collapse

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSS Positioning Question

    I'm one of the many web designers who started out learning to design with tables and knew what CSS was, but never really ventured into it (well, the positioning part of it which is confusing me now).

    I use Macromedia Dreamweaver 8 and have used Dreamweaver for about 4-5 years now (Not quite at a professional level since I started in junior high). I don't handcode my CSS obviously, but have used Dreamweaver's Integrated CSS panel.

    Every website design I have created thus far has been positioned using tables and the only CSS I used was with text styles and color. I have positioned several elements on my current design (images) using the "left" and "top" positioning attributes. I can see how this is a cleaner way than tables, but what do you do when you want to have a background color behind text? In tables, all I would have to do was change the background color of the table cell. How would I add a background color for part of my design using CSS? As of right now I have created a 1x1 pixel image (with the color that I want) and have used CSS to change the size of the image to about the size I would want it behind my text. This just seems a little odd because I am almost positive there is a better way...(I always stay away from stretching images).

    Any help or guidance would be appreciated!

    Thank You!

  • #2
    it's hard to answer specifically without seeing your code, but basically

    .whateverclass {
    background: #000;
    }

    <div class="whateverclass">
    Your text here.
    </div>

    http://www.w3schools.com/css/css_background.asp
    You can fool some of the people all the time, and those are the ones you want to concentrate on. --GWB

    Comment


    • #3
      Originally posted by EC
      it's hard to answer specifically without seeing your code, but basically

      .whateverclass {
      background: #000;
      }

      <div class="whateverclass">
      Your text here.
      </div>

      http://www.w3schools.com/css/css_background.asp
      But if I did that, would I also be able to define the height and width of the text? Would this code create a color background or only a highlight effect?

      Edit: I just tried this and it seems to have only created a highlight effect which I was hoping it wouldn't do.

      Edit 2: Nevermind! It only "looked" like it had the highlight effect in Dreamweaver. When I finally went to look at it in Firefox, it looked the way it should. Thanks for the help guys. If only Dreamweaver made it look like it would in a real browser...
      Last edited by ShiftMedia; 08-10-2006, 10:43 PM.

      Comment


      • #4
        It's the background color for that whole class. You can assign height, width, padding, margins, etc. to a class, but more likely you would assign those to a parent div id (or table or whatever you're using for layout).

        It's always helpful to see the code to give you a proper answer.

        But an example of what I *think* you're after:

        #textbox {
        height: 300px;
        width: 200px;
        padding: 10px;
        }

        .gray {
        background: #333;
        }


        then in the body,


        <div id="textbox" class="gray">
        Your Text Here
        </div>

        You can assign a class multiple times in the document but an ID only once (they are used for layout primarily).
        You can fool some of the people all the time, and those are the ones you want to concentrate on. --GWB

        Comment

        Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2014 Mediabistro Inc.
        Working...
        X