HighDots Forums  

Message created with CSS. What am I doing wrong?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Message created with CSS. What am I doing wrong? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
shapper
 
Posts: n/a

Default Message created with CSS. What am I doing wrong? - 04-29-2008 , 06:13 PM






Hello,

I have been trying to create a simple feedback message do display on a
web site.
I am trying to have a message with an Icon on left and and Text on
right.
If possible both text and image would be vertical aligned to its
container and between themselves.

Anyway, this is what I came up:
http://www.27lamps.com/public/Message.htm

It is not working. And I think the CSS is getting to complex.

Does anyone has a better solution or suggestion to solve this or do a
nice feedback message?

Thank You,
Miguel

Reply With Quote
  #2  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Message created with CSS. What am I doing wrong? - 04-29-2008 , 08:29 PM






shapper wrote:
Quote:
Hello,

I have been trying to create a simple feedback message do display on a
web site.
I am trying to have a message with an Icon on left and and Text on
right.
If possible both text and image would be vertical aligned to its
container and between themselves.

Anyway, this is what I came up:
http://www.27lamps.com/public/Message.htm

It is not working. And I think the CSS is getting to complex.

Does anyone has a better solution or suggestion to solve this or do a
nice feedback message?
I'll say! Also see what happens if you enlarge the text a bit!

Noobie error: use absolute positioning to solve layout problems. Problme
is absolutely positioned elements are removed for the layout flow!

Stop being a code monkey and get the basics down first. My advice is go
through the html and css tutorials at http://htmldog.com

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #3  
Old   
Bergamot
 
Posts: n/a

Default Re: GG Message created with CSS. What am I doing wrong? - 04-30-2008 , 09:17 AM




shapper wrote:
Quote:
I am trying to have a message with an Icon on left and and Text on
right.
If possible both text and image would be vertical aligned to its
container and between themselves.

http://www.27lamps.com/public/Message.htm
This is way more complicated than it needs to be. First off, width:200px
doesn't adapt to various text sizes. Zoom text up a couple notches, or
set IE's text size to Largest and see what happens.

The <p> is absolutely positioned, so it overflows the div container.

Quote:
Does anyone has a better solution or suggestion to solve this
Put the image in the background instead of the foreground and center it
vertically.
<p>Login failed. Please try again</p>

p {
background: #fcc url(Images/Error.gif) 5px 50% no-repeat;
color: #900;
border: 1px solid #c00;
padding: .25em .5em .25em 45px; /* left pad for img size */
}

If you also float it left, it will shrink wrap to fit the text. Add
margins to taste. Set a min-height if you don't want the image cropped
at very small type sizes.

--
Berg


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.