HighDots Forums  

Note-style box with image

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


Discuss Note-style box with image in the Cascading Style Sheets forum.



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

Default Note-style box with image - 05-18-2006 , 04:10 PM






Hi,
What is the best way to set up a "Note block" on a web page with CSS.
This should consist of a colored box that contains an image on the
left, and left-justified text floating to the right.

Example:
_____________________________
IMAGE |XXXXXXXXXXXXXXXXX
Quote:
||||||XXXXXXXXXXXXXXXXX
||||||XXXXXXXXXXXXXXXXX
_____________________________

Quote:
= blank space


Reply With Quote
  #2  
Old   
Barbara de Zoete
 
Posts: n/a

Default Re: Note-style box with image - 05-19-2006 , 02:29 AM






On Thu, 18 May 2006 22:10:18 +0200, Dan <textheads (AT) gmail (DOT) com> wrote:

Quote:
What is the best way to set up a "Note block" on a web page with CSS.
This should consist of a colored box that contains an image on the
left, and left-justified text floating to the right.

Example:
_____________________________
IMAGE |XXXXXXXXXXXXXXXXX
|||||||XXXXXXXXXXXXXXXXX
|||||||XXXXXXXXXXXXXXXXX
_____________________________

| = blank space
Google for two column layout css:
<URL:http://www.google.com/search?q=two+column+layout+css>


--
______PretLetters:

Reply With Quote
  #3  
Old   
Steven Saunderson
 
Posts: n/a

Default Re: Note-style box with image - 05-19-2006 , 03:29 AM



On Fri, 19 May 2006 02:41:55 -0400, Neredbojias
<http://www.neredbojias.com/fliam.php?cat=alt.html> wrote:

Quote:
_____________________________
IMAGE |XXXXXXXXXXXXXXXXX
|||||||XXXXXXXXXXXXXXXXX
|||||||XXXXXXXXXXXXXXXXX
_____________________________

| = blank space

Um, just text and an image? Put both in <div>, float image left.
Will this give the OP space under the image ?

--
Steven


Reply With Quote
  #4  
Old   
Dan
 
Posts: n/a

Default Re: Note-style box with image - 05-19-2006 , 11:28 AM



I tried the following div method. The text wraps under the image. How
can I keep space under the image, and how can I align the text to the
top of the image?

Or should I try creating three divs: one for the image, one for text,
and one to hold the other two?

Or alternatively, would it make since to simply create a div with a
background image of the note image and background color, and put the
text over this image? What are the drawbacks of this method?

What I currently have:
CSS:
#note
{ float: left;
background-color: blue;
margin-top: 2px;
margin-bottom: 2px;
margin-left: 2px;
margin-right: 15px;
}

HTML:
<div id=note><p><img src="note.gif" />Text Text Text Text Text Text
Text</p></div>


Reply With Quote
  #5  
Old   
Dan
 
Posts: n/a

Default Re: Note-style box with image - 05-19-2006 , 12:13 PM



Thanks to all who replied for your help.

I think I have something that works now. Please let me know of any
potential downsides to this method. One problem I am still dealing with
is that the text has to create enough lines to display the entire
image.

<style type="text/css" title="Stylesheet" media="all">
#note
{
background-image: url(note.gif);
background-color: yellow;
background-repeat: no-repeat;
margin-bottom: 10px;
margin-top: 20px;
padding-left: 105px;
}

..noteText
{
color: blue;
}
</style>
<div id=note><p class=noteText>Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text</span></p>


Reply With Quote
  #6  
Old   
zzpat
 
Posts: n/a

Default Re: Note-style box with image - 05-21-2006 , 05:24 PM



Dan wrote:
Quote:
Thanks to all who replied for your help.

I think I have something that works now. Please let me know of any
potential downsides to this method. One problem I am still dealing with
is that the text has to create enough lines to display the entire
image.

style type="text/css" title="Stylesheet" media="all"
#note
{
background-image: url(note.gif);
background-color: yellow;
background-repeat: no-repeat;
margin-bottom: 10px;
margin-top: 20px;
padding-left: 105px;
}

.noteText
{
color: blue;
}
/style
div id=note><p class=noteText>Text Text Text Text Text Text Text Text
Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text Text Text Text Text</span></p

Try adding height: XXpx; to #note.



--
Pat
Impeach Bush
http://zzpat.bravehost.com/

Articles of Impeachment
Center for Constitutional Rights
http://zzpat.bravehost.com/april_200...peachment.html


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 - 2009, Jelsoft Enterprises Ltd.