Borders In HTML without CSS |
Borders In HTML without CSS |
HTMLMAL |
Apr 6 2020, 01:13 PM
Post
#1
|
Group: Members Posts: 4 Joined: 16-March 20 Member No.: 27,237 |
How can i assign border styles to the image i am using for an image map without using css? i tried using a div and it works to allign the image but not the borders ?
ex: <div style = "text-align:center;""border= 3px solid red"> <!-- the align part of the code is working but not the border--> <img src="../webpages/pictures/image_map.png" alt="Workplace" usemap="#workmap" width="768" height="614"> |
Christian J |
Apr 6 2020, 01:43 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,722 Joined: 10-August 06 Member No.: 7 |
How can i assign border styles to the image i am using for an image map without using css? You might use the old BORDER attribute on the IMG element: https://www.w3.org/TR/html401/struct/object...adef-border-IMG (it seems to be removed in the HTML5 spec). The border color is taken from the parent element's text/foreground color. QUOTE <div style = "text-align:center;""border= 3px solid red"> <!-- the align part of the code is working but not the border--> That is in fact CSS, but the syntax should be like this: CODE <div style="text-align:center; border: 3px solid red"> However, note that DIV is a block element, so it (and its border) will normally extend across the whole viewport. |
HTMLMAL |
Apr 6 2020, 04:53 PM
Post
#3
|
Group: Members Posts: 4 Joined: 16-March 20 Member No.: 27,237 |
How can i assign border styles to the image i am using for an image map without using css? You might use the old BORDER attribute on the IMG element: https://www.w3.org/TR/html401/struct/object...adef-border-IMG (it seems to be removed in the HTML5 spec). The border color is taken from the parent element's text/foreground color. QUOTE <div style = "text-align:center;""border= 3px solid red"> <!-- the align part of the code is working but not the border--> That is in fact CSS, but the syntax should be like this: CODE <div style="text-align:center; border: 3px solid red"> However, note that DIV is a block element, so it (and its border) will normally extend across the whole viewport. this worked! but i have found that i needed to assign ids to elements and then style them in the style section however my issue is now centering the image i have #mapphoto{ text-align: center; <!-- the image will not center on the page--> border:3px solid red; } img id="mapphoto" src="../webpages/pictures/image_map.png" alt="Workplace" usemap="#workmap" width="768" height="614"> |
pandy |
Apr 6 2020, 06:13 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,753 Joined: 9-August 06 Member No.: 6 |
this worked! but i have found that i needed to assign ids to elements and then style them in the style section No, you don't have to do that. QUOTE however my issue is now centering the image i have #mapphoto{ text-align: center; <!-- the image will not center on the page--> border:3px solid red; } img id="mapphoto" src="../webpages/pictures/image_map.png" alt="Workplace" usemap="#workmap" width="768" height="614"> Depends on the context how you should do that best and you don't show us the context. The way you try to do it doesn't work because you use text-align: center wrong. 'text-align' aligns text and other inline content (like images) when applied to a containing block element. You can't apply 'text-align' directly to inline elements. Show us more of the page. Meanwhile, read this. CSS: centering things http://www.w3.org/Style/Examples/007/center.html |
Lo-Fi Version | Time is now: 25th September 2024 - 09:13 PM |