WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > PHP + .css - I need to align text right

Reply
  Thread Tools Display Modes
Old 20th April 15, 10:49 PM   #1
anchor
WLC Member
 
Join Date: Jul 2014
Posts: 11
Default PHP + .css - I need to align text right

Hi!

I'd like to align text left? and right in this WP theme:

http://demo.wpmultiverse.com/griffin/


Actually, I'd probably only need to align DATE SECTION RIGHT and
put • in centre. I plan to replace • with fa-fa-icon.

Could this aligning be done through float and how???

Current PHP:

Code:
<div class="teaser-footer">
			<p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> &bull; <?php the_time(get_option('date_format')); ?></span></p>			
		</div>

Here is current css part of the wp-theme I'm using:
Code:
/* ----- post teasers ----- */
#teaser-holder {visibility:hidden;}
.teaser {background-color:#fff; margin:0 15px 30px 15px; box-shadow:0 1px 4px rgba(0, 0, 0, 0.1); -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px;}
.teaser, .teaser .attachment-featured-teaser {width:358px;}
.teaser .attachment-featured-teaser {height:auto; -webkit-border-top-left-radius:3px; -webkit-border-top-right-radius:3px; -moz-border-radius-topleft:3px; -moz-border-radius-topright:3px; border-top-left-radius:3px; border-top-right-radius:3px;}
.teaser-comment-total {float:right; color:#aaa; font-size:10px; font-family:arial,sans-serif; text-align:center; margin-top:4px; width:24px; height:23px; background:transparent url('assets/img/icon-comments-sm.png') 0 2px no-repeat;}
.teaser-title {padding-right:50px; font-size:24px; line-height:28px; margin-bottom:15px;  font-weight:700;}
.teaser-title a {color:#000;}
.teaser-title a:hover {color:#009dd9; transition:color 0.2s ease;}
.teaser-text {padding:15px 20px; line-height:22px;}
.teaser-more {border-bottom:2px solid #009dd9; text-transform:uppercase; padding-bottom:3px; font-weight:700;}
.teaser-footer {background-color:#f7f7f7; padding:10px 15px; color:#999; border-top:1px solid #f1f1f1;}
.teaser-footer img {margin-right:6px;}
.teaser-footer p {margin:0; font-size:13px;}
.teaser-footer span {position:relative; top:2px;}
anchor is offline   Reply With Quote
Old 21st April 15, 07:04 AM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,716
Default Re: PHP + .css - I need to align text right

Show a mockup of what you want please.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 21st April 15, 09:23 AM   #3
anchor
WLC Member
 
Join Date: Jul 2014
Posts: 11
Default Re: PHP + .css - I need to align text right



so: ameo stays left
date section : right

dot in the middle
anchor is offline   Reply With Quote
Old 21st April 15, 10:01 AM   #4
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,716
Default Re: PHP + .css - I need to align text right

Ameo is text which has nothing special

The date should be floated right

The dot should be a background image positioned at center center.

Mock HTML

Code:
<div>
<p id="date">DATE</p>
<p id="ameo">ameo</p>
</div>
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 21st April 15, 12:41 PM   #5
anchor
WLC Member
 
Join Date: Jul 2014
Posts: 11
Default Re: PHP + .css - I need to align text right

you give all of this to me in HTML, man, when I clearly need it in PHP that's written above.

because if it was html I could do it myself, but I'm not sure
where to insert this in php properly.
anchor is offline   Reply With Quote
Old 21st April 15, 12:47 PM   #6
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,716
Default Re: PHP + .css - I need to align text right

All your PHP does is echo values into HTML.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 21st April 15, 12:50 PM   #7
anchor
WLC Member
 
Join Date: Jul 2014
Posts: 11
Default Re: PHP + .css - I need to align text right

could you please then insert for me this code into that snippet??

Code:
<div class="teaser-footer">
			<p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> &bull; <?php the_time(get_option('date_format')); ?></span></p>			
		</div><div class="teaser-footer">
			<p><?php echo get_avatar(get_the_author_meta('ID'), 20); ?> <span><?php the_author(); ?> &bull; <?php the_time(get_option('date_format')); ?></span></p>			
		</div>
anchor is offline   Reply With Quote
Old 21st April 15, 02:47 PM   #8
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,716
Default Re: PHP + .css - I need to align text right

Could I? Yes. Will I? No. Not trying to be mean or rude, but you have very basic code there. It's helping you more by forcing you to learn how to work with it instead of just handing it to you on a silver platter.

Your hint is that anything in the <?php ...?> you don't need to touch. If you read what's there, you can probably guess what each one does.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:59 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.