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
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
Post a Comment