For <img> tags, are the width and height attributes necessary? Could they just
be omitted?
dm 7 6824
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> tags, are the width and height attributes necessary? Could they just be omitted?
They are not required but I recommend their use.
Without this information in the HTML, the UA cannot account for the
viewport space needed for the image. As a result, it happens that if the
user is reading below the image, suddenly the UA discovers the dimensions
and the whole page jumps disconcertingly.
And it's important to be sure the values of height and width are the exact
pixel dimension of the image being used. Don't resize images in the
browser, it leads to either a heftier download than is needed (when HTML
reduces size) or a pixellated ugly image (when HTML increases size).
On Thu, 04 Nov 2004 13:28:12 -0500, Neal <ne*****@yahoo.com> wrote: On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For <img> tags, are the width and height attributes necessary? Could they just be omitted?
They are not required but I recommend their use.
And apologies for the crosspost - followups are now set to ciwah.
Neal wrote: On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For <img> tags, are the width and height attributes necessary? Could they just be omitted?
They are not required but I recommend their use.
Without this information in the HTML, the UA cannot account for the viewport space needed for the image. As a result, it happens that if the user is reading below the image, suddenly the UA discovers the dimensions and the whole page jumps disconcertingly.
And it's important to be sure the values of height and width are the exact pixel dimension of the image being used. Don't resize images in the browser, it leads to either a heftier download than is needed (when HTML reduces size) or a pixellated ugly image (when HTML increases size).
Thanks for the reply. On a related question, if you do provide width and height
attributes, does it matter whether you use <img> tag or CSS attributes?
On Thu, 04 Nov 2004 10:32:14 -0800, DM <elektrophyte-yahoo> wrote: Thanks for the reply. On a related question, if you do provide width and height attributes, does it matter whether you use <img> tag or CSS attributes?
If you provide the height and width in content, the CSS values are not
necessary. Remember that a page can be loaded with images and without CSS.
Whenever the image is part of the HTML, the height and width should be in
the HTML as well.
"DM" <elektrophyte-yahoo> wrote in message
news:41*********************@news.cablerocket.com. .. Neal wrote:
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For <img> tags, are the width and height attributes necessary? Could they just be omitted?
They are not required but I recommend their use.
Without this information in the HTML, the UA cannot account for the viewport space needed for the image. As a result, it happens that if the user is reading below the image, suddenly the UA discovers the dimensions and the whole page jumps disconcertingly.
And it's important to be sure the values of height and width are the exact pixel dimension of the image being used. Don't resize images in the browser, it leads to either a heftier download than is needed (when HTML reduces size) or a pixellated ugly image (when HTML increases
size). Thanks for the reply. On a related question, if you do provide width and
height attributes, does it matter whether you use <img> tag or CSS attributes?
You should do it in the HTML. The height and width of an image are actual
attributes of the image, they're not presentational suggestions. And then
there's no need to do it in the CSS.
*Neal* <ne*****@yahoo.com>: On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For <img> tags, are the width and height attributes necessary?
They are not required but I recommend their use.
For purely decorative images, which correctly have empty 'alt' texts, they
should be omitted, though. Not all of these should or could be included
per CSS.
F'up2 comp.infosystems. www.authoring.html
--
Useless Fact #4:
Coca Cola was originally green.
*Neal* <ne*****@yahoo.com>: On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
For <img> tags, are the width and height attributes necessary?
They are not required but I recommend their use.
For purely decorative images, which correctly have empty 'alt' texts, they
should be omitted, though. Not all of these should or could be included
per CSS.
F'up2 comp.infosystems. www.authoring.html
--
Useless Fact #9:
Percentage of Africa that is wilderness: ca. 28%.
Percentage of North America that is wilderness: ca. 38%. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David D. |
last post by:
If an <IMG> specifies a WIDTH but not a HEIGHT, then height is internally
determined so as to maintain the image's aspect ratio.
Aspect ratio is also preserved if HEIGHT but not WIDTH is...
|
by: Ana |
last post by:
I just ran a report on a site I'm redesigning and came up with all these
missing height/width tags. How important are they? Should I go through the
trouble of making sure they're there?
Ana
|
by: DM |
last post by:
For <img> tags, are the width and height attributes necessary? Could they just
be omitted?
dm
|
by: xiko tripa |
last post by:
Hi. I have an apsx page with a Panel inside. The panel has his
properties Width and Height set to 590 and 390 respectively.
I call a function to make up an table inside this panel. That table...
|
by: Blake Versiga |
last post by:
After pulling an image from the data base and the Image.Height and
Image.Width are not set to the ImageURL's attributes.
1) Is there a way to have these properties updated? or
2) How do I get...
|
by: Robson Carvalho Machado |
last post by:
Dear friends,
I'm dynamically creating a Hyperlink with spacer.gif as ImageURL that is an
1px transparent image only to determine link position, but as I create this
link dynamically I could not...
|
by: Dotcom |
last post by:
I have an ASP.NET application that is mysteriously acquiring height and width
attributes on a particular IMG element on multiple pages. This is not being
caused by someone editing or uploading new...
|
by: Phil Endecott |
last post by:
Dear Experts,
It looks as if the HTML4 spec does not define a meaning for empty height
and width attributes in an IMG element. Moz seems to ignore them, while
IE7 sets the dimension to 1 pixel...
|
by: Christian Hackl |
last post by:
Hi everyone,
I've got a question about what makes the "img" element's width/height
attributes valid HTML or XHTML.
First of all, this is a rather theoretical question, but digging through
the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |