Showing posts with label CAUTION. Show all posts
Showing posts with label CAUTION. Show all posts

Tuesday, 10 March 2015

IMAGE DIMENSIONS AND SCALING

Two attributes of the <img> tag, height and width, specify the height and width of the image in pixels. Both became part of the HTML 3.2 specification, but they’re deprecated in HTML 4.011 in favor of style sheets.
If you use the actual height and width of the image in these attributes (which you find by opening the image file directly in your browser), some older browsers will load and display your web pages much faster than if you don’t include the values.
Why? Old browsers (Netscape 4 and internet Explorer3) couldn’t alder the layout of pages as they were being loaded, so the size of every element on the page bad to be determined before the page could be displayed. These days, browsers can resize elements on the fly so users don’t have to wait for images to download before the page can be displayed. Even so, providing the proper height and width can help your pages render a bit more smoothly, so you should still include them if possible.

TIP

Not only will browsers usually tell you the size of any image you open (in the title bar of the browser window). Just about any application that lets you view or edit image files will display the dimensions of an image as well.

If the values forbid than height are different from the actual width and hight of the image, your browser will resize the image to fit those dimensions. Because smaller images take unless disk space than larger images and therefore take less time to transfer over the network, you can just create a smaller version and then scale it to the dimension you want on your web page. The downside of this technique ist hat the image scaling algorithms built into browsers are not always the best  If you use the height and width attributes to change the size of an image, be prepared for it to look pretty bad, especially if the aspect ratio is not preserved (in other words, you take a 100-by -100 pixel image and expand it into a 200-by-400 pixel image).

CAUTION

Monday, 23 February 2015

CAUTION

 One thing to watch out for: when you specify units in CSS, you must leave no spaces between the number of units and unit specification. In other words, 12pt and 100% are valid,  and 12pt and 100%aren’t

There’s another thing that you can be do with the font-size property that’s not possible with the <font> tag: line height. Let’s not possible with the <font> tag: specify line height. Let’s say you want to use double-spaced text on your page. Before CSS, the only way to achieve the effect was to use the <br>in this manner can look truly awful. To set the line height using CSS, you can include it in you font size specification, like this: font-size: 100/200%. In this case, the size of the font is 100%-the default-and the line height is 200% twice the standard line height.

DO

Do specify fonts using CSS rather than the <font> tag.
Do list backup fonts when specifying a font family order to make it more likely that your users will have one of the fonts you specify.

DON’T

Don’t use too many different fonts on the same page.
Don’t use absolute font sizes with CSS if you can help it, because some browsers won’t let users alter the text size if you do so.

<NOBR> AND <WBR>

Thursday, 12 February 2015

CAUTION

 News URLs like mailto URLs, might not be supported by all browsers.
FILE
File URLs are intended to reference files contained on the local disk. In other words, they refer to files located on the same system as the browser. For local files, file URLs take one of these two forms: the first with an empty hostname (three slashes rather than tow ) or with the hostname as locaslhost:

File://dir1/dir2/file
File://localhost/dir1/dir2/file
Depending on your browser, one or the other will usually work. (if you’re in doubt, you can open the file from within your browser and look at the address bar to see what its file:URL is.)
File URLs are very similar to FTP URLs. In fact, if the host part of a file. URL is not empty or local host. You browser will try to find the given file by using FTP.both of the following URLs result  in the same file being loaded in the same way.
File://somesystem.com/pub/dir/foo/file.html
Ftp://somesystem.com/pub/dir/foo/file.html
Probably the best use of file URLs is in startup pages for your browser (which are also called home pages.). in this instance, because you’ll almost always be referring to a local file, using a file RUL makes sense.

The problem with file URLs is that they f\reference local files, where local means on the same system as the browser pointing to the file-not the same system from which the page was retrieved! If you use file URLs as links in your page, and someone from elsewhere on the internet encounters your page and tries to follow those links, that person’s browser will attempt to find the file on her local disk (and generally will fail). Also, because file URLs use the absolute pathname to the file, if you use file URLs in your page, you can’t move that page elsewhere on the system or to another system.


If your intention is to refer to files that are on the same file system or directory as the current page, use relative pathnames rather than file URLs. With relative pathnames for local files and other URLs for remote files, you shouldn’t need to use a file URL at all

Monday, 9 February 2015

FIGURE 5.4 THE CLAUDIUS HTML PAGE

FIGURE 5.4 THE CLAUDIUS  HTML PAGE











If your browser can’t find the file when you click on the link, make sure that the name of the file in the href part of the link tag is the same as the name of the file on the disk, uppercase and lowercase match, and both files are in the same directory. Remember to close your link, using the </a>tag, at the end of the text that serves as the link,. Also, make sure that you have quotation marks at the end of the filename (sometimes you can easily forget) and both quotation marks are ordinary straight quotes. All these things can confuse the browser and prevent  it from finding the file or displaying the link properly. 
CAUTION