html - putting a point on the right side of a div -


i trying put point on right side of relative (no defined width) div.

html (using wordpress , bootstrap)

<div class="col-md-9 col-md-offset-1">         <h2 class="sml-title"><?php the_category(' - '); ?></h2>   ... 

css

.sml-title { display: inline-block; padding: 15px; color: #fff; background-color: #4ad2dc; }  .sml-title:after { right: 0px; top: 0px; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(136, 183, 213, 0); border-left-color: #88b7d5; border-width: 30px; margin-top: -30px; } 

the problem i'm running arrow goes way right side of screen. want go right after sml-title. can't set width on sml-title because don't control content.

trying accomplish this

enter image description here

if use position: absolute, position element within nearest parent either position: relative or absolute. in case, .sml-title has neither of properties, .sml-title:after not positioned within .sml-title.

if want ::after pseudoelement positioned within .sml-title, you'll need add position: relative or absolute .sml-title


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -