Jump to content

Styled Buttons within HTML Code Element

Go to solution Solved by Ziggy,

Recommended Posts

Good evening,

I run a coffee business, so my website includes brew guide pages for various brewing methods, and as a part of the page, I have added a timer that may be used in line with the guide for timing each step, but I would love to style the shape, colour, and fonts of the buttons to match our branding. I have tried to create a modifier or style section within the code to adjust the corner radius, but nothing seems to work. Can anyone point me in the right direction? I have included the html for the code embed below for reference:

<html lang = "en">
    <head>
       <title>Stopwatch</title>
    </head>
    <body>
        <div><strong>Seconds:</strong> <span id="time">0</span></div>
        </center><input type="button" id="startTimer" value="Start" onclick="start();">
        <input type="button" id="stopTimer" value="Pause"  onclick="stop();">
        <input type="button" id="resetTimer" value="Clear"  onclick="reset();">
    <script>
            var timeElapsed = 0;
            var timerID = -1;
            function tick() {
                timeElapsed++
                document.getElementById("time").innerHTML = timeElapsed;
            }

            function start() {
                if(timerID == -1){
                    timerID = setInterval(tick, 1000);
                }
            }

            function stop() {
                if(timerID != -1){
                    clearInterval(timerID)
                    timerID = -1
                }
            }

            function reset() {
                stop();
                timeElapsed = -1;
                tick()
            }
        </script>
    </body>
</html>

Thank you all.

Link to comment

Can you share the web page URL?

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
  • Solution

Try adding this to your code and adjust the colors and add any of changes to the design:

<style>
  input[type="button" i] {
    background-color:none !important;
    border-color:#c86748 !important;
  }
</style>

 

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
26 minutes ago, laterrarossa said:

@Ziggy Thank you so much! That worked perfectly. I made some UI tweaks and will probably keep working on it, as I would love to add minutes and stages, with instructions to the timers, but this made it look so much better, so thank you again. I really do appreciate it.

Can I ask what chat service you are using? The branding on it is great!

Link to comment
10 minutes ago, laterrarossa said:

@sayreambrosio I am using a WhatsApp Business chat plug-in from Elfsight Apps. I then customized the colours to match my brand as well as added custom wording and my memoji from Apple.

 

https://apps.elfsight.com/panel/applications/whatsapp-chat/

Thank you 🙂 I'll have to check it out. Love the site by the way. Coffee Addict/Snob here.

Link to comment
  • 3 weeks later...
  • 3 weeks later...

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.