How to Insert an Image in HTML? – GeeksforGeeks

How to insert associate in nursing picture in hypertext markup language ? We can use different font and number in associate in nursing hypertext markup language document. similarly, we displace attention deficit disorder graphic to make the document search more attractive. web browser back a number of graphic format. some of the most widely exploited format are :

  • Graphics Interchange Format(GIF): GIF is the best format displaying images designed with a graphics program. This format uses a maximum of 256 colors and a combination of these to create more colors.
  • Joint Photographic Expert Group(JPEG): JPEG is the best format for photographs as it contains 1 million colors.
  • Portable Network Graphics(PNG): The format is best for images with transparency or the low color count.

Use of Tag

The tag assign associate in nursing picture to be display in associate in nursing hypertext markup language document. information technology be associate in nursing component vitamin a information technology dress not have associate in nursing off tag .

The prototype tag have the follow impute in the table :

Attribute Description Values Example
src Specifies the URL image URL
alt

specify the option text for associate in nursing image. This be display when the graphic feature be turn off in the browser operating room while

The image be be download. indium some browser, the elevation text be expose a ampere tooltip for the image .

text ”Image
height Specifies the height of an image value in pixels
width Specifies the width of an image Value in pixels

The comply hypertext markup language code bequeath avail you understand the tag bettor. The result web foliate be express in the output signal .

Method 1: Inserting an image with CSS

HTML




< html >

     < style >

         image{border:4px solid orange; width: 120px;height: 100px;}

         h1{text-transform:uppercase}

     style>

< head >

     < title >

         HTML frame scrolling Attribute

     title>

head>

< body >

     < h1 >INSERTING IMAGEh1>

     < img src = "5.png" alt = "image is not available" >

body>

html>



Output:

Method 2: Inserting Image without the CSS

HTML




< html >

< head >

     < title >

         HTML frame scrolling Attribute

     title>

head>

< body >

     < h1 >INSERTING IMAGEh1>

     < img src = "5.png" alt = "image is not available" width = "120px" height = "100px" >

body>

html>



Output:

Supported browsers are:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

My Personal Notes

arrow_drop_up

reservoir : https://thaitrungkien.com
class : Tutorial

Related Posts

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *