Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #1003078

    I am very new to all this, but learning fast thanks to this great forum. So, my latest issue is that I want find the best way to lay out the quick css code for the following:

    multiple colour sections, each given their own section ID (colsec11) [or a custom class if easier?]. Inside which I then have text and an image that need to be position absolute and have individual settings applied to their translation attributes. I was hoping to keep the custom css class assigned to the floating text(floattxt) and the floating image(floatimg) the same for each colour section and then reference them individually by referencing the coloursection class first. This is what i was hoping would work:

    .txtfloat {position: absolute !important;
    z-index: 20 !important;
    }
    .imgfloat {position: absolute !important;
    z-index: -10 !important;
    }
    
    #colsec11 .txtfloat {
    margin-left: -145px !important;
    left: 17% !important;
    top: 31% !important;
    }
    #colsec11 .imgfloat {
    margin-left: -50px !important;
    right: 48% !important;
    top: -5% !important;
    }}

    Could someone please let me know what i am missing between the coloursection ID and custom classes to make this work?

    #1003344

    Hey Birdster,

    Thanks for the login details and info, though I’m not sure I understand what exactly is not working for you? Please try to explain a bit further if possible or post screenshots highlighting the issue.

    Best regards,
    Rikard

    #1003506

    Hi Rikard,

    Apologies, i just read it back and it does sound very confusing! Because i’m am new to all this, my coding terminology is likely to be incorrect – but will try and explain it better:

    I need to duplicate multiple coloursections. Inside each of these coloursections I have an image and/or text box. These contents will require a custom class to allow me to make the position absolute, and individually translate each one horizontally and vertically.

    I was hoping to keep the custom classes the same for each image and textbox (for ease of duplication and css code) Therefore was hoping there is a way to differentiate each image and textbox by referencing it’s parent coloursection ID followed by the textbox class or image class.

    Similar to how you can separate an element by listing a page-id first:
    .home .custom_image_class {top: 100px;}

    I was wandering if it is possible to separate a custom class by its parents section id. something like: #coloursection01ID .custom_image_class {top: 100px;}
    or maybe using another custom class for the coloursections: .coloursection01class .custom_image_class {top: 100px;}

    Hopefully that makes sense?

    #1003536

    Hi,

    This is possible. First go to Enfold > Theme Options > Layout Builder a tick the “Show element options for developers” checkbox.

    Afterwards go to the advanced layout builder. There you can set a custom id for each color section (i.e. footer_section like in this screenshot: (Email address hidden if logged out) &Expires=1535798957&Signature=Sx8FbgjA59bXm6umPVTn7Ew6rdz2FBV2zKYdC6Xqz9%2BYrDBT7VRrhj9yYA7PWNl%2BdEqEBMZAZ4tfEa1NA3y7CHjRluSg7rZHr6XzqaaJxees7rRTFAEFjNYgmvDd8sHZ81R8skWYWibDwx2S2e4%2BInj36GndeE%2BkEDh5nel1JjvRCNgOkhDKw%2BRYc9OXnyLrnLP%2FdgcXnkZzzGYT7JsdvXJO0y7TyNiNz4anpHp0Tuq%2FeyO85gj5p%2Bf5kCC63H3S1l%2FohWvebC6FAzMm8s%2BWzmOGOvegAUq9oxDlKpBWKbeMNYDleuHN2o7rlRbjiOT3OLCu03zOYL9MjXJcgT83Qg%3D%3D&md5=38863184e64f4b331dba54773139694b&NOT_A_LINK”>Link).

    You can also set a custom css class for all elements inside the section – you just need to scroll down to the “Custom Css Class” settings field (Screenshot: http://www.clipular.com/c/6711384096899072.png?k=RrMoKtXRISy07PSweKZzcezN7Dk ). Please insert all ids or classes WITHOUT css selectors, you don’t need to add # before ids or . before classes (note this only applies to the layout builder setting fields, not to the css code you’re using to style these elements).

    Best regards,
    Dude

    #1003613

    Thanks for getting back so quickly, but not sure that’s answered my question. I know how to apply custom classes, but when inputting the code to style the elements in the quick css field, i don’t know how to reference a custom class (that has multiple elements assigned the same class) but only within a particular coloursection.

    #coloursection01ID .custom_image_class {top: 100px;}

    Assuming it is possible, the above code is missing something between the coloursection (id or class) and the image class,
    such as .container or .contents or .avia-element?

    I was hoping you may have the answer, so that i could apply some code to all the images via it’s custom class but also apply some additional code that only affects those images within a certain coloursection.

    #1004243

    Hi,

    To find the CSS Class and ID please right click and inspect the element. Under the source tab, you should be able to view the HTML code.

    Please check this video for more info https://www.youtube.com/watch?v=rjWUzxMjCAU

    Best regards,
    Vinay

    #1004628

    Appreciate the help Vinay, but my coding skills are not good enough to decipher all the additional code that is surrounding the element when viewed using the developer tools. Long story short, i read the following link:

    https://stackoverflow.com/questions/25796180/targeting-a-class-when-inside-another-class

    And therefore believed it would be possible to target my image element’s custom class by first referencing my colour section custom class. EG:

    .coloursectioncustomclass .imagecustomclass {…}

    But because this didn’t not work, i have decided to create a new custom class for each image in each colour section. It does mean that a lot of my css is repeated, EG:

    .imagecustomclass01 {…}
    .imagecustomclass02 {…}
    .imagecustomclass03{…}

    But at least i know it works.

    #1004677

    Hi,
    To reduce your repeating css rules, you can add several classes to one rule by separating with a comma, like this:

    .imagecustomclass01,.imagecustomclass02,.imagecustomclass03 {…}

    Best regards,
    Mike

    #1005606

    Thanks mike, helpful tip although unfortunately it doesn’t really help me with this situation. I was really hoping to avoid .imageclass01, .imageclass02, .imageclass03 e.t.c and instead have:

    .coloursectionclass01.imageclass
    .coloursectionclass02.imageclass
    .coloursectionclass03.imageclass
    e.t.c

    Unless you can use truncating when referencing classes?
    eg: .imageclass*,
    which would target all classes that begin with “.imageclass”, so any future added classes such as “imageclass04” would automatically receive the assigned parameters – But i’m guessing that is wishful thinking?

    #1005833

    Hi,
    I have tried to re-read your posts, and looked at your page, and looked at your Quick CSS rules.
    I believe what you really want to do is give the same class to a few different elements, which should work.
    I believe that you tried this but it didn’t work due to some error and you have been trying to do this work around.

    Let’s go back to giving the same class to several elements that you want the same css rules on so we can iron out the error, I believe this will help you a lot going forward.
    Please try this on the page in the Private Content area, explain which elements and class, and I will take a look to assist

    Best regards,
    Mike

    #1005976

    Thanks Mike, I really appreciate the extra time taken to look through the site. However, before I re-write the code to how i would like it, could you confirm whether targeting a custom class through it’s parents custom class is even possible? eg:

    .coloursectionclass01.imageclass {margin-left: -145px !important;}
    .coloursectionclass02.imageclass {margin-left: 15px !important;}
    .coloursectionclass03.imageclass {margin-right: 100px !important;}
    e.t.c

    If this is not a possibility, then I am happy to give every colour section and image is own unique class – I just wanted to know if i was missing something before I begin creating lots of individual classes and increasing my workload?

    Thanks again,

    #1006058

    Hi,
    Yes you can, but as written above you will need to have a space between the color section class and the image class,

    .coloursectionclass01 .imageclass {margin-left: -145px !important;}
    .coloursectionclass02 .imageclass {margin-left: 15px !important;}
    .coloursectionclass03 .imageclass {margin-right: 100px !important;}

    Best regards,
    Mike

    #1006073

    Excellent, i will re-write the code and let you know if i have any problems….

    Another question i had was; should it work if I was to use a section id instead of a custom class?

    eg:

    #coloursectionid01 .imageclass {margin-left: -145px !important;}
    #coloursectionid02 .imageclass {margin-left: 15px !important;}
    #coloursectionid03 .imageclass {margin-right: 100px !important;}

    Thanks,

    #1006112

    Hi,
    Yes ID’s or classes would work, but it would be correct to use classes when using for several items the same, ID’s should be used for individual items.
    When you add an ID to a color section it can also be used as an anchor for link, but if you add the same ID to more than one item the link will not work.
    I see above Dude pointed to how to enable custom classes.

    Best regards,
    Mike

    #1006118

    Thanks again Mike,
    I will re-write the code using section ID’s – as there shouldn’t be any duplicates on the same page.
    I will let you know if i have any problems…

    #1006187

    All seems to be working fine, although I’m not actually sure what i’ve done differently compared to when I first tried it and started this thread!

    It may be because the old section ID’s contained underscores, as their naming seems to be quite sensitive. Also, i’m finding that where I place the code within my quick css, relative to other code ive added, seems to make the difference between it working or not!

    Either-way, i’ve got it working – so thank you Mike for going through everything and confirming that what I wanted was in fact correct. Apologies for creating such confusion over nothing!

    #1006234

    Hi Birdster,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.