I am faced with the challenge of placing the a
tag on a new line while maintaining center alignment, without being able to modify the HTML. The display:block
option extends the clickable area beyond the text.
See the screenshot below for the desired outcome
https://i.sstatic.net/8XGXZ.jpg
div{
background: #333;
color: #fff;
margin: 0 auto;
padding: 20px;
text-align: center;
width: 400px;
}
a{
color: red;
display: inline-block;
clear: both;
}
<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. <a href="">This is link in new line</a> Cumque mollitia repellat soluta voluptates molestias veniam reiciendis.
</div>