Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS Wordpress

Featured Replies

Hello,

 

Could someone please advise me what i could do.. What i would like to do is move the line bellow the image (see attachment). The reason why I can just add break tags, is because for every 'author' the paragraph will be diffrent, and i don't want to push the line to far down..

 

Live Example

 

My CSS is...

#author-bio { border-top: 1px dotted #cccccc; border-bottom: 1px dotted #cccccc; padding: 15px 0; }
#author-bio h3 { font-size: 18px; margin: 0 0 10px 0; }
#author-bio h4 { font-size: 14px; margin: 0 0 3px 0; }
#author-bio img { float: left; width: 75px; height: 75px; padding: 2px; border: 1px solid #cccccc; margin: 5px 15px 0 0; }

 

The php code...

<div id="author-bio">
<h3>About The Author</h3>
<?php echo get_avatar(get_the_author_id(), 48); ?>
<h4><?php the_author(); ?></h4>
      <?php the_author_description(); ?>                        
</div><!--end author-bio-->

post-30169-0-03249800-1325370899_thumb.png

Edited by JackDanielTracy

  • Author

#author-bio { border-top: 1px dotted #cccccc; 
border-bottom: 1px dotted #cccccc; /*delete this line*/
padding: 15px 0; }

 

Won't that deleate the line completely? I want to keep it..

<div id="author-bio">
<h3>About The Author...</h3>
<img src="as_files/70000000.jpg" alt="ChloeF" width="64" height="80" class="photo">	<h4>ChloeF</h4>
      Chloe Field is aged 16 currently doing her Silver award (completed Bronze). Chloe’s favourite part of DofE is the volunteering aspect, and during her free time she enjoys to dance and cook.   
<div class="au_bio"></div>	   
</div><!--end author-bio-->		

 

add this in css

div.au_bio{border-bottom: 1px dotted #cccccc;width:100%x;clear:both;margin:10px 0 0 0;height:10px; }

 

<div id="author-bio">
       <h3>About The Author</h3>
       <?php echo get_avatar(get_the_author_id(), 48); ?>
       <h4><?php the_author(); ?></h4>
      <?php the_author_description(); ?>  
<div class="au_bio"></div>                      
</div><!--end author-bio-->

Edited by sash_oo7

Nope:( It was just because I was using a diffrent author, who had a longer bio...

 

Check now..

 

You are getting the line mid-way because the image you used it floated left. You can set a min-height attribute and mimic it with Javascript in IE. BTW, you have a good WordPress theme. Do you have it on the WordPress Theme Directory?

  • Author

You are getting the line mid-way because the image you used it floated left. You can set a min-height attribute and mimic it with Javascript in IE. BTW, you have a good WordPress theme. Do you have it on the WordPress Theme Directory?

 

Thanks, the min-height tag worked fine.

It's always good practice to clear your floats (that includes floating images).

 

In this case it will work better than the min-height attribute.

 

What you need to do is add a clearfix element before the closing of your parent container. Heres how:

 

HTML:

<div id="author-bio">
       <h3>About The Author</h3>
       <?php echo get_avatar(get_the_author_id(), 48); ?>
       <h4><?php the_author(); ?></h4>
      <?php the_author_description(); ?>    
      <br class="clearfix"/>                    
</div><!--end author-bio-->

 

CSS:

br.clearfix { clear:both; display:block; height:1px; margin:-1px 0 0 0; }

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.