Reputation: 194
I can't get this paragraph to display as I want to. The padding between the text and the end of the background should be consistent on every line as shown in this image
HTML
<div id="title-image-container">
<?php echo '<img src="'.get_post_meta($id, 'title-image', true).'">' ?>
<div class="highlight-title"><p><?php the_title(); ?></p></div>
</div>
CSS
#title-image-container {
float: left;
}
.highlight-title {
position: relative;
top: -300px;
padding: 5px 5px 5px 10px;
}
.highlight-title p {
background-color: red;
display: inline;
color: #000;
font: 1.9em 'oswald';
line-height: 60px;
padding: 0 10px;
}
#content img {
height: auto;
margin: 0;
max-width: 100%;
}
Upvotes: 1
Views: 2311
Reputation: 194
I solved this by simply replacing the padding with box-shadow, based on comments found on another website.
.highlight-title p {
box-shadow: 10px 0 0 0 red, -10px 0 0 0 red;
background-color: red;
display: inline;
color: #000;
font: 1.9em 'oswald';
line-height: 60px;
}
Upvotes: 1
Reputation: 2509
This will make your work done--
p{padding-left:5px;
padding-right:5px;
text-align:justify;
word-spacing:5px;}
Upvotes: 0