473,545 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Message created with CSS. What am I doing wrong?

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
Jun 27 '08 #1
2 1391
shapper wrote:
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
Jun 27 '08 #2

shapper wrote:
>
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 <pis 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.

--
Berg
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4696
by: Ben Jones | last post by:
Hi there, I am looking into the ease of implementing the localization/globalization features of .NET using C#. I have a test app which creates a ResourceManager and attempts to load a resource for a specified culture. I created the WinForm application in Visual Studio and added a default *fallback* resource to the main assembly. When I...
1
342
by: JMCN | last post by:
hi, i have this form with the option filter. for some reason, whenever the user chooses OptCreateFilter = 3, they receive an error message "type mismatch 13." i looked at the data type of all three variables (, , ) and they are all YES/NO data types.
1
1796
by: Karl Seguin | last post by:
i have a dynamically created user control which contains a non-dynamically created ASP.Net button. When the button is clicked, the event is not fired. I know that the control must be created on postback, and it is. However, I've noticed an intriguing thing which I think might be at the root of the problem. My page inherits from a basepage,...
1
2840
by: Ramanfromoz | last post by:
Hi, Developing a new we application. Everything okay on my local WIN XP PROFESSIONAL, IIS 5.0 running locally. The website is running smoothly. Now, the same code I am copying over to a WINDOWS 2003 SERVER, I created a new website, allocated port number 6000. Created a release version on my local machine and copied the WEB project from my...
1
3874
by: Andrew Robert | last post by:
Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries an drops it to the local file system. Transmission of the file works as designed but it has a flaw.
6
1849
by: tom c | last post by:
I create 2 data OleDbDataAdapters, one with the wizard, and one in code. I know the adapter created in code is OK because I use it to fill a data table. However, when I try to use the same SQL insert statement in the two adapters, the adapter created with the wizard works fine, but the adapter created in code gives me an error "Object...
3
1604
by: Happy Man | last post by:
Why we created All praise is due to Allah and may His peace and blessings be upon his last messenger (saaw) and on all those who follow the path of righteousness until the last day. We have to answer the most fundamental question that every human being asks himself at some point in his or her lifetime. Not just Muslims, but every...
1
4591
by: dwasler | last post by:
OS Win XP Pro SP2 I had to uninstall my db2 V8 because of WAS Commerce Server 6.0.2 I created an account with admin rights Now went I try to install db2 V8 via the commerce Whiz installer at set up time it keep telling me invalid password Even if I try to install db2 V8 with the Was Commerce server Wiz it will not recongines
2
1925
by: Slippy | last post by:
Hi, python newbie, struggling to learn here. I'm trying to write a simple program which posts messages to my google group (via email). I'm using smtplib, email and email.message to build and send a message, but all the header attributes are appearing in the message body, so my messages are arriving with loads of junk in the body, no subject...
4
2486
by: WP | last post by:
Disclaimer: I'm new at C# so please be gentle. :-) I'm writing a simple card game where two players play against each other through a middle hand they both connect to. In the client (the player) I read messages from the middle hand in an asynchronous fashion. I ran into a problem when I tried to implement the player repsone to the play card...
0
7405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7811
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7428
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7760
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5334
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1887
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.