Keeping it in the box

Thread Solved

Join Date: Dec 2007
Posts: 54
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

Keeping it in the box

 
0
  #1
Mar 2nd, 2009
In this html file I created an area called “branding” where I wanted my name at least at first flush left in the middle of the branding area. The elements behave differently in IE Release candidate 1 than in Firefox. I assume Firefox is correct but how do I get both to behave like IE where the text is:
1) In the middle of the box.
2) Flush left top of box
3) Flush left bottom of the box.
I would be thankful for you assistance.
The code follows:
HTML and CSS Syntax (Toggle Plain Text)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>Untitled Document</title>
  6. <style type="text/css">
  7. /* Branding Text */
  8. .branding{
  9. font-family: Constantia,
  10. "Lucida Bright", Lucidabright,
  11. "Lucida Serif", Lucida,
  12. "DejaVu Serif", "Bitstream Vera Serif",
  13. "Liberation Serif", Georgia, serif;
  14. font-style: italic;
  15. font-size: 30pt;
  16. color: red;
  17. font-weight: bold;
  18. text-decoration: none;
  19. text-align: left;
  20. }
  21. body {
  22. background-color: #000000;
  23. }
  24. #wrapper {
  25. margin: 0 auto;
  26. margin-top: 2px;
  27. padding: 0px;
  28. width: 800px;
  29. min-height: 800px;
  30. background-color: #000000;
  31. }
  32.  
  33. #branding {
  34. padding: 0;
  35. width: 800px;
  36. height: 60px;
  37. clear: both;
  38. background-color: #CCCCCC;
  39. border: inset;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div id='wrapper'>
  45. <div id='branding'>
  46. <p class='branding'>William Bradley Rouse</p>
  47. </div>
  48. </div>
  49. </body>
  50. </html>
WBR
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 54
Reputation: rouse is an unknown quantity at this point 
Solved Threads: 1
rouse rouse is offline Offline
Junior Poster in Training

Re: Keeping it in the box

 
0
  #2
Mar 3rd, 2009
This seems to work for the first part of my question. Is this the way to do it?
HTML and CSS Syntax (Toggle Plain Text)
  1. <div id='branding'>
  2. <span class='branding'>William Bradley </span>
  3. <span class='branding_non_i'> Rouse </span>
  4. </div>
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Keeping it in the box

 
0
  #3
Mar 5th, 2009
Stop using px for sizes, or it will behave totally different when the browser window or the screen resolution changes.

Where the object appears in the box depends on how much margin you give it on each side, and what else is in the box.

With some box objects (but not div), you can set the vertical-align attribute.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC