Jump to content

css in the <head> of some pages with the transparent header

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

1 hour ago, inesgjq said:

Site URL: https://www.inesgomez.com/mes-services

Hello, I am having a problem with some CSS injecting into some particular pages. My header menu is checked to be transparent, which means that we can see the lines of code when we are at the top of my page, do you know if this can be adjusted without having to remove the transparent mode from my header menu?

Capture d’écran 2021-05-14 à 23.07.17.png

Hi. you need to wrap your code with <style> tag. below is a example

<style>//Add CSS code here</style>

Link to comment
9 hours ago, Agha_Waqas said:

Hi. you need to wrap your code with <style> tag. below is a example

<style>//Add CSS code here</style>

thank you for your answer, indeed with these tags we no longer see my lines of code, but they also no longer have an effect on my page, this line of code allowed to create a scrolling question when we clicked on the question . Now the questions are all open with the answer below.

Link to comment
On 5/15/2021 at 1:03 PM, inesgjq said:

thank you for your answer, indeed with these tags we no longer see my lines of code, but they also no longer have an effect on my page, this line of code allowed to create a scrolling question when we clicked on the question . Now the questions are all open with the answer below.

Hi. i just noticed in developer console it shows error. will you double check in the footer section the <script> tag you are using, did you close it like this </script>. due to this markdown code is not working may be

<script>

//js code

</script>

and also i see you added the style tag around the JavaScript code. Correct code is below. copy paste below code into header page. remove yours.

  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
    $(document).ready(function(){
    $('.markdown-block .sqs-block-content h4').addClass('ui-closed').css('cursor','pointer');
    $(".markdown-block .sqs-block-content h4").nextUntil("h4").slideToggle();
    $(".markdown-block .sqs-block-content h4").click(function() {
      
      $(this).nextUntil("h4").slideToggle();
      $(this).toggleClass('ui-closed ui-open');
      });
    });
    </script>
<style>
.markdown-block p {
margin-left:1.5em;
}
 
.markdown-block .ui-closed:before {
  font-family:monospace;
  content:"+ ";
}

.markdown-block .ui-open:before {
  font-family:monospace;
  content:"- ";
}

</style>
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.