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 7798573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:03:02+00:00 2026-06-02T00:03:02+00:00

I would like the Warning icon is always displayed in the vertical middle. In

  • 0

I would like the Warning icon is always displayed in the vertical middle. In my case, the number of error message will be changed.

The following is my code, the output screenshot also attached. enter image description here

can anyone help me? Many thanks!

<style type="text/css">
    #errorMessage{
        padding:5px;

    }

    #icon, #message{
        float:left;
        padding: 5px;
        border:#666 1px solid;
    }

</style>


<div id="errorMessage">
   <div id="icon">

        <img src="images/Warning.png" alt="success" width="28px" />

    </div>
    <div id="message">
        <p>Message1 Message1 Message1 Message1 Message1</p>
        <p>Message2 Message2 Message2 Message2 Message2</p>
    </div>
</div>
  • 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-06-02T00:03:04+00:00Added an answer on June 2, 2026 at 12:03 am

    Personally I’d do it a little differently. I’d make the icon a background image of the overall div, add a little padding and then center it vertically like this jsFiddle example. The image will always be in the middle no matter how tall the container gets due to the background CSS position of 50%.

    HTML:

    <div id="errorMessage">
        <div id="message">
            <p>Message1 Message1 Message1 Message1 Message1</p>
            <p>Message2 Message2 Message2 Message2 Message2</p>
            <p>Message1 Message1 Message1 Message1 Message1</p>
            <p>Message2 Message2 Message2 Message2 Message2</p>        
        </div>
    </div>
    

    CSS:

    #errorMessage{
        padding:5px 5px 5px 40px;
        overflow:auto;
        background: url(http://cdn1.iconfinder.com/data/icons/oxygen/32x32/actions/list-remove.png) no-repeat 0% 50%;
    }
    
    #message{
        float:left;
        padding: 5px;
        border:#666 1px solid;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know why the Visual C++ compiler gets me an warning/error
I'm using VS2008 and would like to create a compile time warning / error
I'm writing a PHP script and would like to present a warning message if
I would like to display a warning message if I am into an editing
I would like to enable Warning as Error on our current project/solution for obvious
I have the warning message given in the title. I would like to understand
I would like a standard reference why the following code triggers a compliance warning
i would like to upload some files with php. i got the following warning:
If a warning or error occurs, I would like to print the name of
Would like to make anapplication in Java that will not automatically parse parameters used

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.