Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

format div box

Posted on 2014-12-14
3
Medium Priority
?
122 Views
Last Modified: 2014-12-29
HI, I want to format text inside the div so it looks more professional with some sort of  background,
In CSS do I need to add further div for each of the text outputs? I a using php to display some data.
I am after a css solution.

 <div class="dashbox">
           <div  class="dashhead">
               Income
           </div>
           
            <?php echo 'Timesheet Income';
             echo '<br><br>Current Pay Period'. $ test;
             echo '<br>Last Pay period';
            echo '<br><br>Fortnight';
             echo '<br>Month';
           
            ?>
        </div>


.dashbox {
    height:300px;
    width:300px;
    border:1px solid blue;
   
   
}
0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40499473
so it looks more professional with some sort of  background
How so?
0
 

Author Comment

by:jagguy
ID: 40499806
I just need this to look better and is there an easy way to format the text without another div
0
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 total points
ID: 40500462
That's a very subjective question because what looks good to one person looks awful to another. Having said that, CSS is only responsible for styling the content, so getting your content right is the first step. You look like you about to catch DIVitis! Don't forget, you can style all the HTML tags, not just DIVs:

Have a look at this:

<div class="dashbox">
   <h1>Income</h1>
   <dl>
      <dt>Timesheet Income</dt>
      <dd>Current Pay Period: <?php echo $test ?></dd>
      <dd>Last Pay Period: </dd>
      <dd>Fortnight: </dd>
      <dd>Month: </dd>
   </dl>
</div>

Open in new window


Now you can use CSS to style the elements exactly as you like:

.dashbox { height:300px; width:300px; border:1px solid blue; }
.dashbox h1 { color: red; margin-bottom: 1em; font-size: 2em; }
.dashbox dt { font-weight:bold; color: green; font-size: 1.2em; }
.dashbox dd { font-style: italic; }

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question