How to create an HTML element with a visual non-editable prefix
Overview
In this shot, we'll create an HTML element with a visual non-editable prefix.
Example
In the example below, we'll create an HTML element with a visual and non-editable prefix country code. And an input element that will accept the phone number. Let's look at the code below:
Explanation
In the HTML tab,
- Line 5: We create a
formelement. - Line 6: We create a
divwithclass = "content". - Line 7: We create a
spanelement withclass = "prefix". - Line 8: We create an
inputelement of typetel.
In the CSS tab,
- We add the necessary style to the elements.
Output
The output shows an HTML element with a visual non-editable prefix (country code) and an input element that accepts the phone number.