Img source close tag - css

I am using img tag but its not working this is my code
<img src="resources/images/dsr_sprites.png" ></img>
and I have also use that type
<img src="resources/images/dsr_sprites.png" />
but when I open in firebug that have no close tag and we we use that code for itextpdf its also showing error message that img close tag is missing

Img tag is self closing, also on html 5 you can if you want, not closing the tag.
xHtml:
<img src="image.jpg" alt="My image" />
Html5
<img src="image.jpg" alt="My image">
Please dont forget the alt attribute.

i think you use this type your image tag:
<img src="../resources/images/dsr_sprites.png" />

It looks like you're using the incorrect path, so your HTML can't find your image anywhere.
The second tag is correct, but your path needs to be relative. Check out this article for more on the difference between absolute and relative paths.
<img src="../resources/images/dsr_sprites.png" alt="Sprites"/>

Related

Put a pop-up text on hover of mouse

I have an image like this one:
<img class="alignnone size-full wp-image-262" src="http:/localhost/wp-content/uploads/2017/10/myimage.png" alt="" width="352" height="343" />
I would like to put text in a box and this appears when the mouse hovers on from the image. How is it possible to make it?
You can use:
<img ... title="TEXT HERE">
Here's a quick JSFiddle demo for you.
https://jsfiddle.net/23vbh1ov/
<img src="http://dev.benchanmusic.com/wp-content/uploads/2017/07/cropped-cropped-me_blackandwhite.jpg" alt="" width="352" height="343" title="TEXT HERE" />
You should also fill in the "alt" property, as it's used for search engine indexing as well as if the image itself fails to load for any reason.

Floating an image in a particular way in the WP post editor

I can't float my image the way I want in the post editor. I need to have it sit next to several separate elements (2 different headings + a paragraph), not just one element. And I see no way to do that.
Any suggestion would be welcome.
I would do it in the text tab of the editor like this.
<img src="my image" style="float:right" />
<h3>Title</h3>
<h4>Discription</h4>
<p>paragraph text</p>
You want the <img> with the float:right property first, then the rest of headings and the paragraph
Here is a demo http://jsfiddle.net/d55psoqq/
Note: the Wordpress "alignright" property usually added when you add an image with the media manager, will do the same as the style="float:right;" if it is properly defined in the stylesheets. (I have encountered some themes were it is not defined) If "alignright" does not work you can add it to the main stylesheet like this...
.alignright {float:right;}
Update:
To get all the text to stay at the left and never flow under the image, you need to force it into a column like this...
<img src="http://placehold.it/350x200/" style="float:right" />
<div style="overflow:hidden">
<h3>Title</h3>
<h4>Discription</h4>
<p>paragraph text</p>
</div>
Demo http://jsfiddle.net/d55psoqq/3/

Img src attribute and page performance

There are two img tags in my aspx page as shown below.
<img src="../Images/icon1.png" class="img-style" alt="Icon" />
<img src="../Images/icon1.png" class="img-style" alt="Icon" />
Both img tags are using the same css class and same image as the src attribute.
There came an argument like "Removing the src attribute of each img tags and adding the same image as the background-image in the CSS class is better and performance efficient".
I need an expert opinion regarding the above statement with the correct reason. If I remove the src attribute and add the image as background-image in the "img-style" css class, how it helps to improve performance?
Please help. Thanks.
Got a prompt reply from : http://forums.asp.net/post/5739756.aspx
Thanks to AidyF.

image src attribut issue

I am storing images in a folder on a localhost for asp.net website.
The image is there and and the src attribute is correctly formed but the image is not displayed in img element.
can some body tell me what can be the issue or missing.. when I check the image in the url of brower it is displayed properly
localhost:xxxx/TenModified/setX/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg
This is my markup for the element
<img id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderChild_ListViewThumbs_ctrl1_ctl03_Image1" src="localhost:59657/ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg" style="border-width:1px;border-style:Solid;height:172px;width:172px;" alt="">
You don't need to include the domain and port. The following will work fine for the src:
/ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg
or the full tag:
<img id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderChild_ListViewThumbs_ctrl1_ctl03_Image1" src="/ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg" style="border-width:1px;border-style:Solid;height:172px;width:172px;" alt="" />
use this:
src="ProfileTenModified/setP..."
full code:
<img id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderChild_ListViewThumbs_ctrl1_ctl03_Image1" src="ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg" style="border-width:1px;border-style:Solid;height:172px;width:172px;" alt="" />
You should remove the "localhost:59657" from the path. You really don't need it, just be root relative. This will save you a lot of time when you launch your application not having "localhost:59657" in there and just being root relative. You won't need to change all of your paths. Same holds true for any anchors. Make those root relative too.
<img id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderChild_ListViewThumbs_ctrl1_ctl03_Image1" src="/ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg">
Try to use Prefix. Http or Https
http:// localhost:xxxx/TenModified/setX/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg
<img src="http :// domain:port/TenModified/setX/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.jpeg" />
Your link is is missing the two forward slashes in the protocol?
<img id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolderChild_ListViewThumbs_ctrl1_ctl03_Image1" src="localhost//:59657/ProfileTenModified/setP/8fd7976b-d4b0-467a-bc3e-bf2a51d60299.Jpeg" style="border-width:1px;border-style:Solid;height:172px;width:172px;" alt="" />
and also the slash for the closing of the image tag

Move text next to logo; get rid of a hard rule

Here's the site: www.red-tuxedo.com
I want the "Red Tuxedo" text to sit next to the logo, not below, and I want to get rid of that hard rule that runs through the logo. My CSS / HTML skills aren't up to it. I completely destroy the column layout when I change the text and I can't find the hard rule in the code. Tried adjusting the gif (cut off the bottom in Photoshop) and that didn't help.
I did write to the person who created the template; haven't heard back after several days. Would like to get this fixed before I start adding more pages.
thx
One way is to move the logo within the #logo div:
<div id="header-logo">
<div id="logo"><img height="60" width="60" alt="Red Tuxedo Logo" src="logo_red_tuxedo.gif" id="logo_red_tuxedo"/><span class="red">Red</span>Tuxedo</div>
<form action="#" class="search" method="post">
<p><input type="text" class="textbox" name="search_query"/>
<input type="submit" value="Search" class="searchbutton" name="search"/></p>
</form>
</div>
Try changing the div (id=logo) so that it includes the logo image and the text and add align='absmiddle' to the image. I'd suggest CSS but it looks like it has fixed attributes on it anyway. The "rule" looks like it is coming from the background image for the body element. You'd need to update the file bg.gif to modify it, I think.
<div id="logo">
<img id="logo_red_tuxedo" src="logo_red_tuxedo.gif"
alt="Red Tuxedo Logo" align="absmiddle" height="60" width="60">
<span class="red">Red</span>Tuxedo
</div>
To move the text, I'd put the image inside the logo div, the way dmondark suggested. As for the hard rule, it's part of the background image for the body, bg.gif. Here's an edited version I made that doesn't have it.

Resources