a (anchor) elements can also be used to create internal links to jump to different sections within a webpage.
To create an internal link, you assign a link's href attribute to a hash symbol # plus the value of the id attribute for the element that you want to internally link to, usually further down the page. You then need to add the same id attribute to the element you are linking to. An id is an attribute that uniquely describes an element.
Below is an example of an internal anchor link and its target element:
When users click the Contacts link, they’ll be taken to the section of the webpage with the Contacts header element.
You can use 'a’(anchor) element to link to content outside of your web page.
'a' elements need a web destination address called an href attribute. It also needs an anchor text to click on it.
The browser will display the anchor text which is 'Unsplash' when you click on it will takes you to 'https://www.unsplash.com’.
a (anchor) elements has some attributes like:
Target attribute takes some parameters like:
<a href=’https://www.freecodecamp.org' target=’_blank’>Go to freecodecamp</a>
<a href=’https://www.freecodecamp.org' target=’parent’>Go to freecodecamp</a>
<a href=’https://www.freecodecamp.org' target=’itself’>Go to freecodecamp</a>
HTML is a markup language that uses a special syntax or notation to describe the structure of a web page to the browser. HTML elements usually have opening and closing tags that surround and give meaning to content but some HTML elements don’t have closings tags like
<img src=’image path’/>
This is opening tag
This is closing tag
And self-closing tag is
HTML is the building block of a website like skeleton in our body and brick or stone in a house.
Someone says that HTML is a programming language but it’s a misconception.
The meaning of programming language is to add logic into your program…
In HTML img element is used to display every types of images like:jpg, png, jpeg...
It can also display svg.
img element has many attributes but the most common ones are:loading, src, srcset, height, width and alt.
When we wanna to put image into website we have target the path or address of that image we interested in it.
It’s implementation looks like below:
Inside src attribute we can put local images path or online path.
The second important attribute is alt attribute, you have to always include this attribute into your img element because sometimes your image path isn’t…
If you are a web developer or a web designer and want to promote your css knowledge, I personally recommend you to look at these following pictures. These are the pictures of the websites that inspire you to create maintainable and powerful websites and web apps for your clients and audiences.
In this article, I guide you on how to manipulate or alter the style of an HTML element via the style method inside JS.
According to the CSS when we write inside an HTML file we use the style tag to write in as well in JS we use the style method to alter the style of an HTML element.
For example, we have h1 tag with some text inside it. I want to alter or change its color,font-size,font-family…
In this article, I teach you how to write HTML markup inside JS.
This method returns HTML element content like innerText and textContent if any HTML element is available inside that element text then innerHTML returns that element along with its content as a normal text.
It seems like innerText but it’s not accurate. As I mentioned yesterday we can alter the content of an HTML element in JS via DOM methods.
For example, if you want to write Hello friend and the friend word must be in the bold format you can achieve this via innerHTML inside JS.
In this article, I intended to teach you how to alter the HTML element innerText and text content.
If you target an HTML element and write console.dir(elementName) you’ll soo many attributes. if you scroll down and in I section you’ll see innerHTML, innerText and in T section you’ll see textContent. In this session, I teach you innerText and textContent and in the next lesson,k I’ll teach innerHTML which is very important.
If you write the above code and open your browser console by pressing ALT+SHIGT+I.
In this article, I’m going to teach the DOM methods.
If you want to access your HTML element and add changes to it the one approach is accessing by its class name.
For example, you have a paragraph(p) tag and want to access it by its class name.
we have p tag with para class name now I want to add changes to it or access it in my JS file.
I am a web developer who writes web development content for you to make web development easier