Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1264301

    Hi guys,
    In a the text tab of a text block, I use to have the following code:
    <h1 style="font-size: 50px; text-align: left; color: #a81010; text-shadow: 1px 1px 2px white;">This is my H1 text</h1>
    It works fine.

    Using now a unique custom ID attribute to manage my H1’s, I’ve tried to rewrite that code in the css area but wasn’t able to make it work.
    The ID attribute is “rv-h1-portfolio” and here is the last try I’ve written, with no effect at all:

    #rv-h1-portfolio .h1 {
       font-size: 50px; 
       text-align: left; 
       color: #a81010; 
       text-shadow: 1px 1px 2px white;
    }

    Anyone can correct and help me getting the right code please ?

    #1264317

    Hello,

    please try with h1#rv-h1-portfolio instead of #rv-h1-portfolio .h1

    #1264322

    Thx Cherrmann,
    Unfortunately, it doesn’t work.

    #1264326

    Question
    Am I supposed to use the ‘Custom ID Attribute’ field or the‘Custom css class’ one?
    I’m getting confused…

    #1264327

    sorry, please try #rv-h1-portfolio h1 without the dot.

    if you use a class you would use the dot before the class name in the CSS and you could then reuse the class name somewhere else. If you use an ID you would only use it once and address it with #ID-name

    #1264329

    Nope that one (#rv-h1-portfolio h1) doesn’t work neither, I had tried it already.
    Thx for trying ;)

    #1264613

    Hi rvga,

    Could you post a link to where we can see the problem you are having?

    An ID should be unique for a single page, but a class can be used many times.

    Best regards,
    Rikard

    #1264693

    Rikard, you can check on that page: https://c-serp.fr/clients-references/service-seo-strategie-de-contenus-blog-vacance-enfant/
    I declared in the Custom css Class of the first text block: “rv-h1-portfolio”
    And in the quick css, I wrote:

    #rv-h1-portfolio h1 {
       font-size:50px; 
       text-align:left; 
       color:#a81010; 
       text-shadow:1px 1px 2px white;
    }

    Obviously that doesn’t work.

    An ID should be unique for a single page, but a class can be used many times.

    Ok, so I undesrtand that these 2 fields do the same job, except that the Custom ID is unique to a page, portfolio or a post and that the Custom css class can be shared among many pages, portfolios or posts, am I right?

    #1264719

    Hi again,

    the heading “Service SEO : stratégie de contenus” is not formatted as H1 but as paragraph

    Either you change it to H1 in the text editor (recommended) or you use

    .rv-h1-portfolio p {
        font-size: ...
    }
    #1264720

    ooh right I see…
    So let’s say I change it into an ‘h1’ (instead of p) then the quick ccs code would be:

    .rv-h1-portfolio h1 {
        font-size: ...
    }
    • This reply was modified 3 years, 4 months ago by rvga.
    #1264724

    It works fine now and I understood the way it works thanks to both of you
    Geee… I’m getting smarter and smarter at css stuff ;)

    • This reply was modified 3 years, 4 months ago by rvga.
    #1264733

    One more last question please….
    Everything works fine except the text-size which remains at 40px when I asked for 50px in the quik css.
    Any clue?

    #1264737

    Ok I found, I have had declared another css property for H1’s in the advanced style options… it was kinda conflicting.
    It’s all good for me.
    Many thanks for the help guys.

    #1264859

    Hi rvga,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘rewriting css properties’ is closed to new replies.