![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Industry Role:
Join Date: Jul 2016
Posts: 4,613
|
Need some help with CSS and divs
Hi,
Can anyone help me with a little formatting problem I have? There are two problems: 1. In the image below, the full review links are not lined up. Obviously, this is due to the length of the review snippet above. How can I align them? ![]() [click to view] 2. Also, in that image the div image looks rubbish. I think this is the CSS code that deals with it. Code:
a.readmore span { display: block; background: url(images/readmore.png) no-repeat; height: 38px; padding: 0 0 0 19px; } ![]() [click to view] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Jun 2003
Posts: 3,277
|
Code:
<div class="site"> <div class="review-container"> <div class="review">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Reiciendis sunt cupiditate placeat, tempora quia illum <a class="read-more" href="#">Read More</a> </div> <div class="review">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Reiciendis sunt cupiditate placeat, tempora quia illum adipisci sequi est beatae obcaecati, quibusdam asperiores aut ducimus sed sint voluptate quasi sit provident. <a class="read-more" href="#">Read More</a> </div> <div class="review">Lorem ipsum dolor, est beatae obcaecati, quibusdam asperiores aut ducimus sed sint voluptate quasi sit provident. <a class="read-more" href="#">Read More</a> </div> </div> </div> <style> .site { max-width: 1170px; margin: auto; padding: 20px; ; } .review-container { display: grid; grid-template-columns: 1fr; grid-gap: 40px; } .review { padding: 20px; padding-bottom: 40px; position: relative; box-shadow: 0 0 6px rgba(0, 0, 0, .1); } .read-more { padding: 10px 30px; position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%); background: #6f9454; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .4); border-radius: 25px; border: 1px solid #435f2f; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .1), 1px 1px 3px rgba(0, 0, 0, .3); text-decoration: none; } @media all and (min-width: 992px) { .review-container { grid-template-columns: 1fr 1fr 1fr; } } </style> ![]()
__________________
dead. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
So Fucking Banned
Industry Role:
Join Date: Jul 2016
Posts: 4,613
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Industry Role:
Join Date: Mar 2003
Location: San Diego
Posts: 32,177
|
Quote:
https://ryulion.com/layout.htm
__________________
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
So Fucking Banned
Industry Role:
Join Date: Jul 2016
Posts: 4,613
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jun 2003
Posts: 3,277
|
Quote:
Code:
<div class="review-container"> // Start your loop of reviews .. <?php foreach ($reviews as $review) { ?> <div class="review"> <?php echo $review->description; ?> <a class="read-more" href="<?php echo $review->link; ?>">Read More</a> </div> <? } ?> </div> And of course, my CSS must be added to your CSS file As a side note, you may want to remove the 'site' class I used, when using this code, I set a max width to it, that may not match your site, or theme.
__________________
dead. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
So Fucking Banned
Industry Role:
Join Date: Jul 2016
Posts: 4,613
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
|||||||
|
|||||||
Bookmarks |