So I want to try to do this in html and css but I can’t seem to find anything. I only way I can think is by importing the text as an image but that will look bad. P.S Light blue line is for centering as I am designing the site in Photoshop first
<p class="test">
Conact Me
</p>
.test {
border-top-style: solid;
border-bottom-style: solid;
border-bottom-width: 1px;
}
5
Answers
Try using borders to achieve the look you are wanting:
You can use border-top in css to create a line above text.
border-top property
Example of use
A simple solution is using
text-decoration: underline overline;
.Well, you’d want to have the text element within a div, set the bg color property of the div to the color you’re going for, and then set margins for the text element to push off the text by ~10px or so (looks like that’s about where it’s at in your mock up). From there you can set a border to only top, and bottom and style accordingly.
You can put the text inside a block level element and apply a top and bottom border. Advantage of this method against the
text-decoration: underline overline;
is, that you can simply define the space between text and lines withpadding
as you need it.To make the width as long as the text is, just use
display: inline-block;
.