/    Sign up×
Community /Pin to ProfileBookmark

How to add break to span class? Simple question

  • 1. I have code like: <span class=”subheading3″>Subheading</span>
  • I would like to add break line for each span row that it will not be in the same line. How to do it?

  • 2. I have code for p within ID class like:
    [code=php]#mainctnR1 p{
    margin:0em 0em 1em 0em;
    text-indent:0em;}
    [/code]
  • If I have many class for p within such p how to name this class in #mainctnR1
    like code:

    [code=php]<p class=”subheading3″>Subheading</p> [/code]

    to post a comment
    CSS

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @FangApr 25.2007 — 
  • 1. span .subheading3 {display:block;}


  • 2. ? explain or give another example
  • Copy linkTweet thisAlerts:
    @toplisekauthorApr 25.2007 — thank you for reply.

    Number two is problem, that I have Id in css like: #mainctnR1

    There is code within this ID for p like


    <div id="mainctnR1">

    <p>My text within paragraph</p>

    </div>

    As I need also different description for p I do not know how to

    name this in css as there is already description for paragraph like

    #mainctnR1 p{

    margin:0em 0em 1em 0em;

    }
    Copy linkTweet thisAlerts:
    @FangApr 25.2007 — Do you mean like this:&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
    &lt;html lang="en"&gt;
    &lt;head&gt;
    &lt;title&gt;css&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;

    &lt;style type="text/css"&gt;
    #mainctnR1 p {
    color:red;
    }
    p {
    border:1px solid blue;
    }
    &lt;/style&gt;

    &lt;/head&gt;
    &lt;body&gt;
    &lt;div id="mainctnR1"&gt;
    &lt;p&gt;My text within paragraph&lt;/p&gt;
    &lt;/div&gt;
    &lt;p&gt;Onopam lu mo brabomem ros bocegue est.&lt;/p&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    Copy linkTweet thisAlerts:
    @CentauriApr 25.2007 — You can declare a class describing an element that already has a style defined, so long as the class is defined AFTER the general style:
    [CODE]#mainctnR1 p{
    margin:0em 0em 1em 0em;
    text-indent:0em;}

    #mainctnR1 .subheading3 {
    font-size: 1.5em;
    font-weight: bold;
    }[/CODE]


    [B]However[/B], as your code seems to suggest the new style <p> is a subheading, [B]MAKE[/B] it a subheading - ie. <h> tag. Therefore html [CODE]<div id="mainctnR1">
    <h3>Subheading</h3>
    <p>text here</p>
    </div>[/CODE]
    and css [CODE]#mainctnR1 p{
    margin:0em 0em 1em 0em;
    text-indent:0em;}

    #mainctnR1 h3 {
    font-size: 1.5em;
    font-weight: bold;
    }[/CODE]


    Cheers

    Graeme
    ×

    Success!

    Help @toplisek spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...