Carrd CSS Styles

Here is a collection of CSS Styles that I use in my Carrd websites.

Hide Untitled Captions

When using Lightbox, you can enter a caption. If you don't enter a caption, clicking the image shows Untitled as the caption. This script will remove Untitled so if you have no caption for a particular photograph, you will just get a blank caption.



<script>
/* Hide UNTITLED Caption */
(function () {
function hideUntitledCaption() {
const caption = document.querySelector('.gallery-component-modal .caption');
if (!caption) return;if (caption.textContent.trim().toUpperCase() === 'UNTITLED') {
caption.style.display = 'none';
} else {
caption.style.display = '';
}
}
const observer = new MutationObserver(hideUntitledCaption);observer.observe(document.body, {
childList: true,
subtree: true,
characterData: true,
attributes: true
});
hideUntitledCaption();
})();
</script>

External Smugmug Embed

This takes a SmugMug embed link and expands it to center the display and include default sizes.



/* Smugmug Embed Custom */
<div style="
width:100%;
display:flex;
justify-content:center;
">
<iframe
src="https://www.smugmug.com/frame/slideshow?key=LjRD37&speed=3&transition=fade&autoStart=1&captions=1&navigation=1&playButton=0&randomize=1&transitionSpeed=2"
style="
width:800px;
max-width:100%;
height:600px;
border:0;
"
scrolling="no">
</iframe>
</div>