URL with Protocol
URL input with a non-editable `https://` prefix that visually integrates with the field. Submit value is the full URL; users only type the host portion.
URL with Protocol the 25th of 28 designs in the 28 CSS Input Field Designs collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.
Live preview
The code
<label class="if-url">
<span class="if-url-label">Website</span>
<span class="if-url-wrap">
<span class="if-url-prefix">https://</span>
<input
type="text"
name="url-host"
inputmode="url"
placeholder="codefronts.com"
pattern="[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}.*"
/>
</span>
</label> .if-url {
display: grid;
gap: 6px;
width: 100%;
max-width: 320px;
}
.if-url-label {
font-family: "JetBrains Mono", monospace;
font-size: 10px;
letter-spacing: 0.12em;
color: #b8b6d4;
text-transform: uppercase;
}
.if-url-wrap {
display: inline-flex;
align-items: stretch;
background: #1a1a22;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s;
}
.if-url-wrap:focus-within {
border-color: #06b6d4;
}
.if-url-prefix {
display: inline-flex;
align-items: center;
padding: 0 12px;
background: rgba(6, 182, 212, 0.08);
color: #06b6d4;
font:
600 12px/1 "JetBrains Mono",
monospace;
border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.if-url input {
flex: 1;
min-width: 0;
padding: 12px 14px;
border: 0;
outline: none;
background: transparent;
color: #f0eeff;
font:
500 14px/1 system-ui,
sans-serif;
}
.if-url input::placeholder {
color: #b8b6d4;
}