WordPress.org

Forums

css style disappearing from div (3 posts)

  1. cardinal4
    Member
    Posted 9 years ago #

    How come when I put in css styles via <div style="">, and press save and publish, my Div Tag gets turned into <div> and the style disappears?

  2. monkeypup
    Member
    Posted 9 years ago #

    For CSS to affect a Div, you should use


    <div id="">

    or


    <div class="">

    Classes can be edited with periods, IDs with Number signs. As in the example:


    #header
    {
    Width: 780px;
    }

    .headertitle
    {
    Color: red;
    }

  3. cardinal4
    Member
    Posted 9 years ago #

    Is there really no other way? Like via a plugin? It wouldn't make sense just to keep updating the style sheet for all the different layouts you sometimes want for each post.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.