I added a back button with this code GO BACK how can I change the color of background and text of just this button? I am using the Dawn theme.
Topic summary
A user added a back button to their Shopify store using <button onclick="history.back()">GO BACK</button> and wanted to customize its colors.
Solution provided:
- Add an ID attribute to the button:
<button id="history-back-btn" onclick="history.back()">GO BACK</button> - Apply CSS targeting that ID to change background color, text color, and border
CSS example:
#history-back-btn {
background-color: black;
color: black;
border: 1px solid white;
}
The user initially asked which CSS file to use but then confirmed they figured it out. A follow-up question about border color was addressed with updated CSS code showing the border property.
Please replace the button HTML with this, adding an ID so we can target it.
Then apply the CSS for this
“background-color” for the background
“color” for the text color
#history-back-btn {
background-color: black;
color: black;
}
which .css file do I add it to please
figured it out Thanks soooooo much oh border color?
#history-back-btn {
background-color: black;
color: black;
border: 1px solid white;
}