Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / April 2008



Tip: Looking for answers? Try searching our database.

Message created with CSS. What am I doing wrong?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 30 Apr 2008 00:13 GMT
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
Jonathan N. Little - 30 Apr 2008 02:29 GMT
> Hello,
>
[quoted text clipped - 12 lines]
> 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

Signature

Take care,

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

Bergamot - 30 Apr 2008 15:17 GMT
> 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.

> 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.

Signature

Berg

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.