BEGINNERS' CODING HOME

Learn HTML,CSS, Python etc from the foundation

Showing posts with label IMAGE. Show all posts

Tuesday, January 15, 2019

HOW TO USE IMAGE AS A LIST ITEM MARKER IN CASCADING STYLE SHEET

2 comments :


Can you vividly remember one of our lessons in HTML  where I talked about ordered list and unordered list? Fine. In that lesson, I talked about ordered and unordered list; how to use numbers or bullets for listing items. If you’ve forgotten, then don’t feel shy. Just click Here for a brief reminder. In this lesson, I’m going to be adding milk and sugar to the tea using CSS.  What I mean here, is that I will be teaching you how to use images or icons in addition to the normal number or bullets you've learned earlier.
Apart from images or icons, you can as well use awesome shapes such as circle, square, triangle etc to mark your lists items. I will teach you everything in this lesson if you are willing to follow me practically with that smartphone in your hand. Let's get started.
For example, let’s say I want to list my favorite foods using one particular picture (you can use more than one if you wish), then all I need to do is to write the following codes into my text editor. (You can also write them, I will explain later.)

HTML
<p>Here are my favorite Foods</p>
<ul>
<li>Fried Rice</li>
<li>Squashed Potato</li>
<li>Ofe Nsala</li>
</ul>

CSS
ul{
  list-style-image: url('give.jpeg');
  list-style-position: inside;
}
li{
  font-size: x-large;
}
REFERENCE THE CSS IN YOUR HTML FILE. IT WILL LOOK LIKE THIS



SAVE AND OPEN IT, IT WILL LOOK LIKE THIS

NOTE:
PLEASE, USE SMALLER IMAGE, WHEN YOU ARE PRACTICING. I DON’T HAVE ANY ON MY COMPUTER.

EXPLANATION

a)     List-style-image: is used to define the image you want to use as list item.
b)    List-position: Is used to specify the position of the list marker box. It can be outside or inside. To know the difference, try replacing the above example with outside
c)     color: Is used to define the color of the list item.
d)    Font-size: Is used to specify the size of the list item. It can be small, medium, large, xlarge or xxlarge.

 To Add Circle or other shapes
In your HTML
write
<ul class=''circle''>
and then begin to list your items with <li> tags. When you're done, close the <ul> tag.

CSS
Go to your CSS file and remove ''list-style-image'' and add
ul.circle{
list-style-type: circle;
}

WRAPPING UP

Our next lesson will be the last on CSS basics. We will move to the latest version of CSS (i.e CSS3) and subsequently move to JavaScript course. Keep practicing.

Monday, December 24, 2018

PRACTICAL STEPS ON HOW TO ADD IMAGE AND LINK TO A WEB PAGE USING HTML

No comments :






In today’s lesson, you will be learning how to insert an image and embed link using HTML. I will explain in simple steps how you to add an image to a web page, with the backing of illustrative example. And in the latter part of this lesson, I will devote my time, take you by hand and then walk you through the procedures you can use to add link to a page, image or text.
Let us now begin.

1.     ADDING IMAGES TO A WEB PAGE
Adding image to a web page can be very captivating. Images play a very significant role on the pages of websites or blog. It is simply an ‘attention grabber ‘ of web pages. Studies have equally shown that visitors of a website or blog tends to stay longer on the pages with colorful images or pictures than those that contain only texts.  
For you to add image on a web page, what you need to do is to use image tag. Image tag in HTML is usually represented by  <img> . this implies that you can insert image(s) on a web page by simply introducing  <img> tag within the <body> tags of HTML document.  The complete format you will use to insert image is:
<img     src=’’imagename.jpg’’ />
TAKE NOTE
a)     Make sure that the image you intend to add is in the same folder where you will save your HTML file.
b)    Also, remember to add the .jpg extension, even if the image on the folder shows an extension of ''.jpeg''
c)     Note that the smaller the image size, the faster the page load speeds.

For further, elucidation, it will be lovely if we harmoniously consider at least one example.
So, kindly open your text editor and write the following codes below:
<html>
       <head>
           <title>Unachukwu Daniel</title>
      </head>
      <body>
          <img src="Daniel.jpg" alt="">
      </body>
</html>

It will look like this


Save it in a folder that has an image bearing Daniel (or any name you wish to use. Then open it.
It will look like this
 

Isn’t it amazing? Of course, it is! Let's move to the next subject matter.

2.     Adding Link to a web page using HTML
I would like to define ‘link’ idem per idem. So, a ‘link’ is used to link one thing (e.g image, text, pages etc. ) to another place. Links can be inbound or outbound. If it is inbound, it will link one thing from another within the website or blog. When it is outbound, the link will be going out of the website or blog entirely to another website. 
The formula for adding link in HTML  goes like this:
              <a   href=’’the link’’ target ‘’   ‘’’>link title
             </a>
 For example, let’s say I want to add a link to a page titled ‘Contact us’ in our tutorial website www. Codinglioness.b;logsppot.com.
I will follow this step
              <a   href=’’https://www. Codinglioness.b;logsppot.com./contact-us/’’ target ‘’   ‘’’>Contact Us
             </a>

                                WRAPPING UP
I believe you’ve learnt something in this lesson. Our next lesson, we will also treat two topics before we move to HTML 5.  Till then, keep practicing, keep learning.