/    Sign up×
Community /Pin to ProfileBookmark

Images are center but I don’t want it to.

Ok I created images for my paragraph headers and I am using the text-align:left; to get the image to align to the left but it keeps centering. Please let me know what I’m doing wrong. Thank you.

  • Monty
  • [Code]

    /*Home Page*/

    #mainbody {
    margin:0;
    padding:0;
    width:100%;
    font-family:Arial, Helvetica, sans-serif;
    text-alight:left;
    }

    img.maintext {
    margin:0;
    padding:10px;
    border:none;
    text-align:left;
    }

    h1.maintext {
    margin:0;
    padding:10px;
    font-family:Arial, Helvetica, sans-serif;
    text-align:left;
    font-size:16px;
    font-weight:bold;
    }

    h2.maintext {
    margin:0;
    padding:5px 10px;
    text-align:left;
    font-size:14px;
    font-style:italic;
    text-decoration:underline;
    }

    p.maintext {
    margin:0;
    padding:5px 10px;
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    text-align:justify;
    }

    [/Code]

    [code]

    <div id=”mainbody”>

    <img class=”maintext” src=”Images/DidYouKnow.jpg” />

    <p class=”maintext”>some stuff</p>

    <img class=”maintext” src=”Images/ShareOurExcitement.jpg” />

    <p class=”maintext”>some more stuff</p>

    <p class=”maintext”>some other stuff</p>

    <p class=”maintext”>some other stuff</p>

    <p class=”maintext”>some other stuff</p>

    <p class=”maintext”>from stuff</p>

    </div>

    [/code]

    to post a comment
    CSS

    5 Comments(s)

    Copy linkTweet thisAlerts:
    @KravvitzAug 09.2006 — They don't look centered to me.

    Why are you using so many classes?

    Why didn't you specify the alt attributes on the images?
    Copy linkTweet thisAlerts:
    @MontyVauthorAug 09.2006 — Ok I just moved up the CSS tree and realized for some reason while starting building my stylesheet I put text-align:center. I guess it just took a minute before the clouds of frustrations cleared. Thanks for all who viewed.

  • - Monty
  • Copy linkTweet thisAlerts:
    @MontyVauthorAug 09.2006 — They don't look centered to me.

    Why are you using so many classes?

    Why didn't you specify the alt attributes on the images?[/QUOTE]


    I used the classes to seperated paragraphs. What is the best way to do this? I have not set any alt tags yet because I was only using fillers at the moment. I'm trying to practice on general layouts since I'm fairly new to CSS.
    Copy linkTweet thisAlerts:
    @KravvitzAug 09.2006 — I would remove the classes and use selectors like this instead:
    #mainbody p
    Copy linkTweet thisAlerts:
    @MontyVauthorAug 11.2006 — I would remove the classes and use selectors like this instead:
    #mainbody p[/QUOTE]


    Ok I get it. Thanks for the tip.
    ×

    Success!

    Help @MontyV 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 6.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: @nearjob,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...