Can I simulate a row of spacer/text/spacer with one HTML block?
RobR
Registered Users Posts: 48 Big grins
I just posted a rant on the Feature Requests category asking for spacers and other elements not to change size when a new element is added in the same row. I think it should be possible to replace an alternating series of spacers and text blocks with a single HTML block. I tried doing it with this HTML:
<div width=10%></div> <div width=15% style="text-align:center;font-size:x-large"> Trains Gallery 1 </div> <div width=75%>
That didn't work. It just gave me "Trains Gallery 1" centered in the page. Is there a way to do this?
Tagged:
0
Comments
I don't understand what you're trying to do.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Take a look at this page, which uses the custom button HTML you were kind enough to show me a couple of days ago: https://www.smugmug.com/app/customize/Trains-and-Railroads-Page
The text over the slideshows is the title I specified as part of the slideshow settings. It's left-justified over the slideshow. I want it centered. The easiest way to do that would be to remove the title from the slideshow and add a row above the slideshows consisting of a spacer 10% wide, an HTML block 15% wide, and a spacer 75% wide. (Eventually, there will be more slideshows in each row, but this will do for a start.) But placing each of those elements one at a time and making sure they all have the correct width is a royal pain. I would like a single block of HTML that would do the same thing as the three blocks that would be in that row.
The HTML I posted is supposed to create an empty section that is 10% of the width of the screen, then a section that is 15% of the width of the screen that contains the slideshow title, and then an empty section 75% the width of the screen.
I just realized that I am missing the closing tag, but putting it in didn't change anything. All I get is the phrase "Trains Gallery 1" centered on my page.
Page not found.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Oops. That was the customize page. This link should work: https://crumbs-of-reality.smugmug.com/Trains-and-Railroads-Page
I looked up the right way to set width and changed the HTML to this:
I'm getting closer. The text is now close to the left side of the screen. But the left div should be 10% of screen width. The middle div, containing the text, should be in the same position as the slide show.
The HTML block is below the line of text that says "General Galleries". Below the HTML block is a row that consists of a 10%-width spacer, a 15%-width slide show, and a 75%-width spacer.
By looking at the page source, I see that I could get centered titles by playing the CSS for the sm-page-widget-header class, but I would like to have an answer to the original question anyway for future reference.
You current HTML will not work. Those "empty div's" need content for it to work. You'll probably need to use grid (https://css-tricks.com/snippets/css/complete-guide-grid/). I don't have a lot of experience with it, but I'm willing to look into it.
Why not just use Galleries and be done with it? IMO a bunch of small slideshow will look busy and take a long time to load.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Have you looked at your home page on a mobile device yet?
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
I don't want to use Galleries because I don't have a choice of which galleries to include. It just gives me all galleries in a folder. I want the two categories, "General" and "Specialized". I will try slideshows, and if they end up taking too long to load, I can switch to single photos.
You once said you'd never use spacers, instead using HTML blocks to position elements on your screen. How do you do that?
You can select specific Galleries to display.
My gallery page ( https://gallery.imagesinthebackcountry.com ) is one HTML/CSS block.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Thank you.
In case anyone cares, here's an answer to my original question: a table.
I took the liberty of converting your "Train and Rail" spacers and text blocks to one HTML/CSS Block to give you an idea on how to do it. The
margin: 0 auto;
basically sets that "container" with a top/bottom0
margin and right/leftauto
(centers it) at 80%.HTML
CSS
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
They aren't responsive. Check it on a mobile device.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Good point, but my gallery isn't aimed at mobile users.
You really don't control how your users view your site. While I usually look at photo sites on my computer I will also look on a mobile device.
Your approach also doesn't work well in a browser window that does not take the full width of my monitor. The following screen shot was taken with a reasonably sized browser window on a large monitor. Is this how you want your viewers to see your site?
Musings & ramblings at https://denisegoldberg.blogspot.com