|
-
May 10th, 2007, 11:31 PM
#1
Thread Starter
PowerPoster
<img/> or CSS
What is the best way to add an image to a web page, if I want to load up the page quickly?
Using traditional <img/> tag or through CSS file…..
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
May 10th, 2007, 11:39 PM
#2
Re: <img/> or CSS
I dont think there is a difference. What you will want to do is make the image optimized for smaller size and only loose a minimal amount of quality that is acceptable to you.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 10th, 2007, 11:55 PM
#3
Re: <img/> or CSS
There is no speed difference, however there is a semantic difference.
Use an image element if the image is relevant to the page content. The page should make sense with CSS disabled.
Use a CSS background-image property if you're just adding visual effects to the page that have no bearing upon the content.
-
May 11th, 2007, 05:38 AM
#4
Re: <img/> or CSS
PNG is very good for graphics that don't have many colors or that have colors that blend nicely together. There are optimizers that minimize the file size.
GIF works the best for the smallest and least colorful graphics (ie. two or 16 color graphics).
JPEG works for everything else.
Another thing that affects page loading is the amount of files: less files to load is usually better with slow connections. Loading from one server is also faster than loading from two or more servers. With fast connections you can't really see the difference.
-
May 14th, 2007, 12:25 PM
#5
Re: <img/> or CSS
One more thing, using a <img> tag gives you the opportunity to enhance your page's SEO by providing a description in the alt attribute
-
May 17th, 2007, 12:47 AM
#6
Thread Starter
PowerPoster
Re: <img/> or CSS
 Originally Posted by RobDog888
I dont think there is a difference. What you will want to do is make the image optimized for smaller size and only loose a minimal amount of quality that is acceptable to you.
If the image is too large I can cut it into small parts, isn't it
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
May 17th, 2007, 12:49 AM
#7
Thread Starter
PowerPoster
Re: <img/> or CSS
 Originally Posted by Merri
GIF works the best for the smallest and least colorful graphics (ie. two or 16 color graphics).
Correct
All the time use GIF. Easy to work with it, even on the paint.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
-
May 17th, 2007, 05:24 PM
#8
Re: <img/> or CSS
 Originally Posted by eranga262154
Correct
All the time use GIF. Easy to work with it, even on the paint.
MS Paint for graphic design????
/me calls the men in the white jackets.
-
May 21st, 2007, 09:42 PM
#9
Thread Starter
PowerPoster
Re: <img/> or CSS
 Originally Posted by the182guy
MS Paint for graphic design????
/me calls the men in the white jackets.
Just for the simple design, like a icons or a small images.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|