Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 745727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:37:00+00:00 2026-05-14T09:37:00+00:00

This is another noobish mistake from me but I’ve placed some text in my

  • 0

This is another noobish mistake from me but I’ve placed some text in my page but after adding some padding to my div tag it’s impossible for me to place my Text in the vertical center. Here is a preview of my problem:

My Problem

The CSS:

body {
    background-image: url(../images/body-bg.jpg);
    font-family: arial;
}

.cms-head {
    background-image: url(../images/cms-head.png);
    background-repeat: no-repeat;
    width: 850px;
    height: 50px;
    padding: 5px;
    margin-bottom: -10px;
}

.posts-list {
    background-image: url(../images/new-post-b.png);;
    width: 840px;
    height: 500px;
    padding: 5px;
    border-bottom: 1px solid #000000;
}

.content {
    width: 850px;
    height: 500px;
    margin-left: auto;
    margin-right: auto;
}

.edit-post-but {
    background-image: url(../images/new-button.png);
    background-repeat: no-repeat;
    width: 60px;
    height: 40px;
}

.post-title {
    width: 834px;
    height: 40px;
    background-image: url(../images/post-head.png);
    background-repeat: no-repeat;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    margin-left: auto;
    margin-right: auto;
    padding: 5px;
    font-size: 20px;
    color: #ffffff;
}

.bottom {
    width: 850px;
    height: 50px;
    background-image: url(../images/cms-bot.png);
    background-repeat: no-repeat;
}

a:active, a:link, a:visited{
    color: #ffffff;
}
a:hover{
    text-decoration:none;
}

The HTML/PHP:

<html>
<head>
<title>Blog Name | Edit Post</title>
<link rel="stylesheet" href="css/cms.css" type="text/css" />
</head>
<body>
<div class="content">
<div class="cms-head">
<a href="newpost.php"><img src="images/new-button.png" /></a>
<a href="#"><img src="images/rss-button.png" /></a>
</div>
<div class="posts-list">
<?php
mysql_connect ('localhost', 'root', 'root') ;
mysql_select_db ('tmlblog');

$result = mysql_query("SELECT timestamp, id, title FROM php_blog ORDER BY id DESC");

while($row = mysql_fetch_array($result)) {
    $date  = date("l F d Y",$row['timestamp']);
    $id = $row['id'];
    $title = strip_tags(stripslashes($row['title']));

    if (mb_strlen($title) >= 50) {
        $title = substr($title, 0, 50);
        $title = $title . "...";
    }
    print("<div class='post-title'><a href=\"update.php?id=" . $id . "\"><img src='images/edit-button.png'></a>$title<br /></div>");
}

mysql_close();

?>
</div>
<div class="bottom"></div>
</div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T09:37:01+00:00Added an answer on May 14, 2026 at 9:37 am
    div.post-title
    {
      padding-bottom: 10px;
    }
    div.post-title > a > img
    {
      margin-bottom: -6px;
    }
    

    The margin and padding may need some adjustments to make it look good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is no doubt another noobish question, but I'll ask it anyways: I have
I asked this question in another post - How do I put a <div>
I originally started this question in another thread, but that thread was sorta, kinda
I know we've done this before in another .aspx page that's using this master
I I have read this url first official and this another blog But they
Is this another MS Access 2000(2007)-ism? If I type the following: foo = blah
i need to show a menu that derive another menu and this derive another
I have a file like this: This is a sentence. This is another sentence.
I'm writing bug tracking software in PHP, and today I saw this in another
This isn't another debate on brackets vs dot-notation. I noticed in Xcode that when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.