HomeОбразованиеRelated VideosMore From: smashtheshell

How to create custom css underline less than width of headline | CSS3 Quick Tip 2016 - Youtube

50 ratings | 4706 views
How to create custom css underline less than width of headline using after pseudo selector | CSS3 Quick Tip 2016 - Youtube Learn to create a css underline aligned in the middle of the text by using after pseudo selector. It will not be created using a normal text-decoration property instead we'll use a little technique to create this custom css3 underline which will look like a short border bottom to text headline. We will use css positioning to position or align the underline to the bottom of the text with reduced underline width, and underline aligned in the middle of the text. We can't use normal text-decoration property to provide a short width to underline and color to this underline in all the browsers. Although there is a way to specify the color for the text underline using text-decoration-color: value; however its not supported in all the browsers. So here you will how we can provide colors to the underline using css3 custom border/underline using after pseudo selector. *************************************************************** Navigate to specific portion of the video, Click on timestamp: 00:21 | Understanding the underline problem and solution 1:15 | Writing heading text and styling the text with normal text-decoration property 2:10 | Creating custom underline with reduced width - using after pseudo selector 4:11 | Aligning the small width border / underline in center of the text headline **************************************************************** ===============Try Using SOURCE CODE================ http://codepen.io/smashtheshell/pen/XdEjbw ======================================================= Have any questions, just comment below in comment section. I will try to respond as soon as possible. Like share and comment! Thanks ================Links to other playlists================= - HTML5 Fundamental Video Tutorials 2016 Playlist https://www.youtube.com/playlist?list=PLVTV0IQIXRztWItvjT1b8yI7bJIwh_1lX - Three ways to create responsive equal height columns using CSS https://www.youtube.com/playlist?list=PLVTV0IQIXRzsqX7CX9RcXmJg8dh5U5xRB - How to create a header navigation with centered logo https://www.youtube.com/watch?v=zBRxUIYvNX4&list=PLVTV0IQIXRzt_b2L91VaGo2-8kMg3Udu3 - Creating Responsive Image Gallery using pure css3 https://www.youtube.com/playlist?list=PLVTV0IQIXRztYDt0GZb-F_tLS9OXzdhSK ============Awesome Videos on CSS3============= Creating CSS3 Tooltip without using jquery or javascript https://www.youtube.com/watch?v=5rVhVmVoI3s Styling placeholder text using css3 https://www.youtube.com/watch?v=xCtmJogajxc Creating three column responsive layout https://www.youtube.com/watch?v=G8UTSXxu1ow ************************CONTACT and RESOURCES************* Find all the source codes here: https://codepen.io/smashtheshell Follow on Twitter https://twitter.com/amit4kp Add on Facebook https://www.facebook.com/kumaramit24chd Like Page on Facebook https://www.facebook.com/smashtheshell Share this video and Subscribe to this channel for latest updates and web design tips and techniques.
Html code for embedding videos on your blog
Text Comments (8)
Ali Elsayed (2 months ago)
Thank you bro
KAPIL KAUSHIK (5 months ago)
thank you bro.. i searched for this video a lot thank you very much
GrimProduction (9 months ago)
Et merciiiii bg
Gamal Abdall (1 year ago)
That was really nice and informative, Thanks man you explained it well.
smashtheshell (1 year ago)
Hey Gamal, apologies for the late reply. I am glad you liked the tutorial. Thanks for watching.
Danny S (1 year ago)
can you do this with :hover instead of ::after?
Infopedia Spark (1 year ago)
Thank you sir you saved my life ..
smashtheshell (1 year ago)
It's a great pleasure to hear that.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.