[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/29/2009 at 08:25AM PDT, ID: 24770433 | Points: 500
[x]
Attachment Details

CSS Font widths

Asked by Treder in Cascading Style Sheets (CSS)

Tags: css, font, width

Hi,

I'm trying to generate a generic stylesheet for my projects.  I would very much appreciate it if someone could let me know the best practise for defining fonts in a stylesheet.

Surely a <p>, <h1> etc tag should be display:block by default, yet somewhere down the line of my layouts I'm having to stipulate it AND the exact width of the div it is contained within, or else I'm getting display:inline behaviour - the same thing happens with <li>'s  - I'm confused about what the definitive answer (if that's ever possible with so many interpretations).

So for example, what would be the correct css for the following:

* {
      margin:0em;
      padding:0em;
}
body {
      margin:0 0 0 0;
      padding:0;
      background: #000;
      font-weight: normal;
      font-size: 9pt;
      font-family: arial, futura, helvetica ;
}

h1,h2,h3
{
      font-weight: normal;
}

p
{
      font-weight: normal;
      font-size: 1.05em;
      line-height: 1.2em;
      padding-top: 0.77em;
      padding-bottom: 0;
      margin-bottom: 0;
}

#right-content {
      float:left;
      padding: 15px 0 0 0;
      width:600px;
}
#right-content p {
      float:left;
      width:595px; /* Needed ??  or should it be width:100% ? */
      padding:0 0 12px 5px;
}

<div id ="right-content">
   <p>What's right, </p>
   <p>what's wrong - on a line below, dammit!</p>
</div>

As I posted the code above from my stylesheet, I'm wondering whether * {      margin:0em;padding:0em; } is what's causing me problems.

Comments very much appreciated
Tony
[+][-]09/29/09 08:31 AM, ID: 25450163

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 08:31 AM, ID: 25450167

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 08:37 AM, ID: 25450232

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 08:43 AM, ID: 25450287

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 11:00 AM, ID: 25451551

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/29/09 11:03 AM, ID: 25451579

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/14/09 02:04 AM, ID: 25820018

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625