473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

image border?

roN
Hi,

I have an image and I would like to draw a border around it, I tried:
<p style="border:1px border-style:solid; border-color:#EEEEEE;
background-color:#FFFFFF;"><img src="./images/header.jpg" width="800"
height="130" border="0" ><br>
but I don't get a border, why not? Where am I going wrong?
Thank you!
--
chEErs roN

I'm root, I'm allowed to do this! ;)
keep on rockin'
Mar 1 '06 #1
7 2191
roN schreef:
Hi,

I have an image and I would like to draw a border around it, I tried:
<p style="border:1px border-style:solid; border-color:#EEEEEE;
background-color:#FFFFFF;"><img src="./images/header.jpg" width="800"
height="130" border="0" ><br>
but I don't get a border, why not? Where am I going wrong?
Thank you!

Walk this way:

<p><img src="./images/header.jpg" width="800"
height="130" border="0" style="border: 1px solid #EEEEEE;" /><br></p>

Watch the shortened css-markup (and the closure of the p-tag)

--
Niek
Mar 1 '06 #2
Els
'sNiek wrote:
<p><img src="./images/header.jpg" width="800"
height="130" border="0" style="border: 1px solid #EEEEEE;" /><br></p>

Watch the shortened css-markup (and the closure of the p-tag)


Watch the border="0" in there - sure you need it? ;-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 1 '06 #3
roN wrote:
I have an image and I would like to draw a border around it,
It's generally best to include the border into the image itself.
It can be done in CSS, too, though.
I tried:
<p style="border:1px border-style:solid; border-color:#EEEEEE;
background-color:#FFFFFF;"><img src="./images/header.jpg" width="800"
height="130" border="0" ><br>
but I don't get a border, why not? Where am I going wrong?


1) You are trying to set the border on the paragraph, not the image.
(There's a difference. A paragraph has 100% width by default.)
2) You have a syntax error in the style sheet (missing semicolon after
"1px"). Use the W3C "CSS Validator" to detect syntax errors in future.
3) You have invalid markup: no alt attribute. This does not affect the
rendering, though, except when the image is not displayed.
4) You are setting background-color without setting color. This may
matter when the alt text, rather than the image, is displayed.

It's questionable whether <p> (paragraph) markup is adequate here. It
might if the alt attribute's value is a full paragraph's worth of text.
More normally, you would write

<div><img
alt="ACME International"
src="images/header.jpg"
style="border: solid #eee 1px; background: #fff; color: #000"
width="200" height="130"></div>

(If the image acts as a top-level heading for the page, use <h1> instead
of <div>.)
Mar 1 '06 #4
Els
Els wrote:
'sNiek wrote:
<p><img src="./images/header.jpg" width="800"
height="130" border="0" style="border: 1px solid #EEEEEE;" /><br></p>

Watch the shortened css-markup (and the closure of the p-tag)


Watch the border="0" in there - sure you need it? ;-)


Eh.. and the <br> not having any purpose right before </p> (I think
the original example was taken from a piece of code with more lines
after the image within the same paragraph), and the 'XHTMLisation' of
the image element, while the rest is/was in plain HTML.
Oh, and the missing alt attribute.

Hmm.. yup, that's about it I think :-)

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 1 '06 #5
roN
Els wrote:
Els wrote:
'sNiek wrote:
<p><img src="./images/header.jpg" width="800"
height="130" border="0" style="border: 1px solid #EEEEEE;" /><br></p>

Watch the shortened css-markup (and the closure of the p-tag)


Watch the border="0" in there - sure you need it? ;-)


Eh.. and the <br> not having any purpose right before </p> (I think
the original example was taken from a piece of code with more lines
after the image within the same paragraph), and the 'XHTMLisation' of
the image element, while the rest is/was in plain HTML.
Oh, and the missing alt attribute.

Hmm.. yup, that's about it I think :-)


Hmm yup, thank you guys,
I now have following:
<img src="./images/header.jpg" width="800" height="130" border="1"
style="border: 1px solid border-color:#EEEEEE;">
but the border stays black, why? I would like to have it light grey.
Thank you!

--
chEErs roN

I'm root, I'm allowed to do this! ;)
keep on rockin'
Mar 1 '06 #6
roN skrev:
<img src="./images/header.jpg" width="800" height="130" border="1"
style="border: 1px solid border-color:#EEEEEE;">
but the border stays black, why? I would like to have it light grey


<img src="./images/header.jpg" width="800" height="130"
style="border: 1px solid #EEEEEE">
--
Topposter du svar, dvs. skriver dit svar over det citerede,
så ryger du på min ignoreringsliste.
Svar under det du citerer og citer kun det du svarer på - tak.
http://usenet.dk/netikette/citatteknik.html
Mar 1 '06 #7
Knud Gert Ellentoft <el*******@mail.tele.invalid> wrote in
news:v6********************************@dtext.news .tele.dk:
roN skrev:
<img src="./images/header.jpg" width="800" height="130" border="1"
style="border: 1px solid border-color:#EEEEEE;">
but the border stays black, why? I would like to have it light grey


<img src="./images/header.jpg" width="800" height="130"
style="border: 1px solid #EEEEEE">


Yep, got rid of the deprecated border attribute and fixed the css
syntax error (missing semi-colon), but still missing alt which is a
required attribute of <img>. If there is no appropriate alternate text
to use, at least use alt="".

--
Stan McCann, "Uncle Pirate" http://stanmccann.us/
Webmaster, NMSU at Alamogordo http://alamo.nmsu.edu/
Now blocking Google Grouper posts and replies.
http://blinkynet.net/comp/uip5.html
Mar 2 '06 #8

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

Similar topics

8
by: JLahm | last post by:
I have defined a class for my images called .image that specifies the default border color, width and style. I'd like to be able to have the pseudo elements link, visited and active have one color...
2
by: Lars Forslin | last post by:
I have a problem with making image hyperlinks work in Firefox/Netscape. It seems the clickable area is narrowed down to a small area in the middle of the image, around the edges or gone altogether....
9
by: Karl Burrows | last post by:
I am working on a Website for a non-profit group and for some reason I have one link that doesn't want to cooperate. All the image links work fine with the onmouseover and onmouseout script except...
1
by: John Thompson | last post by:
We're sooo close. When we load the page to upload the image, all of the prms go through except the binary image data. Using SQL server with the data type set to "image". Please help! Thanks-...
6
by: abdullah1983 | last post by:
Hi Guys, I need some clarification regarding the problem with safari browser. Please find my code below. I'm setting the image src, mouseover and mouseout using javascript. The mouseover and...
10
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
0
by: punitshrivastava | last post by:
Hi to All, I am Punit Shrivastava.i created one html page for this i cde like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
11
by: Evolution445 | last post by:
I got this code, and it somehow doesnt work. <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center"> <TR> <TD background="{image-path}navfiller.gif" HEIGHT=40...
2
by: studentofknowledge | last post by:
For some unknown reason ie is placing images I have in a div in a weird way. One image is overlapping another but this problem is not occuring in mozilla. I have looked at my code over and over again...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.