Trouble Centering Text
frisson
Registered Users Posts: 22 Big grins
Hi,
I have a menu centered on my page and want to use CSS to center the gallery name under the menu.
I tried using this
/*Center the Gallery Title*/
.sm-user-ui .sm-gallery-cover .sm-gallery-cover-title, .sm-user-ui .sm-gallery-cover .sm-gallery-cover-description {
font-size: 30px;
color: black;
text-align: center;
}
However the text does not appear to be centered under the menu.
For reason beyond my understanding I am not allowed to post links. But if you google my name you can see an example gallery (try Radiance)
I am a neophyte CSSer, so would appreciate any help.
Thanks
Robert Boire
I have a menu centered on my page and want to use CSS to center the gallery name under the menu.
I tried using this
/*Center the Gallery Title*/
.sm-user-ui .sm-gallery-cover .sm-gallery-cover-title, .sm-user-ui .sm-gallery-cover .sm-gallery-cover-description {
font-size: 30px;
color: black;
text-align: center;
}
However the text does not appear to be centered under the menu.
For reason beyond my understanding I am not allowed to post links. But if you google my name you can see an example gallery (try Radiance)
I am a neophyte CSSer, so would appreciate any help.
Thanks
Robert Boire
0
Comments
You can't post live links because you are new. You can type in your name i.e 'yoursite.com' and that should be fine. Googling 'radiance' was not helpful.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Mike -
I think this is his site - http://www.robertboire.ca/Portfolio2/Radiance/.
Musings & ramblings at https://denisegoldberg.blogspot.com
It really is centered based on the cover title's block. Because it's also inline with the slideshow. Add this to your custom CSS to change the default
max-width: 85vw
to100%
:Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Thanks @denisegoldberg, I didn't see it on the first page and I wasn't going to search further.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Thanks for the code, but it did not quite work. I must be missing something. The title pops to the center, briefly and then reverts back off center. And there is a new problem...the slide show icon on the right of the page has disappeared.
Here is the code I am using. Thanks for your help.
.sm-page-layout-region sm-page-layout-region-left {
min-height:100% important;
}
/*1.3 20-10-15 remove button for image size*/
.sm-button-image-sizes {
display: none;
}
/*Center the Gallery Title*/
.sm-user-ui .sm-gallery-cover .sm-gallery-cover-title, .sm-user-ui .sm-gallery-cover .sm-gallery-cover-description {
font-size: 30px;
color: black;
text-align: center;
}
/*Change max width to allow gallery title to center with slideshow button */
.sm-user-ui .sm-gallery-cover-info .sm-gallery-cover-title {
max-width: 100%;
}
.sm-button, .sm-button-size-large, .sm-button-skin-default, .sm-gallery-cover-slideshow-button:after {
content: "Slideshow" !important;
padding: 8px;
}
.sm-gallery-cover-slideshow-button {
color:black !important;
background-color: rgba(255, 255, 255, 0.9) !important;
}
I didn't see the slideshow icon before either. You have code that hides it.
I made some changes, so remove this code:
Use this instead.
Because you display the Slideshowtext/icon, SmugMug adds this:
So I had to compensate by adding a
margin-left: 108px;
so your Gallery Title will center.I also added a
margin-left: -40px
to your Slideshow text/icon so it will be inline (right side) to the thumbnails. I also addedsm-user-ui
before some of your code so you don't have to use the!important
.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 had to change
margin-left: 108px;
to
margin-left: 250px;
to really center the text.
The only code interfering with the Slideshow icon seems to be the code with the Slideshow text itself. If I remove:
.sm-user-ui .sm-button,
.sm-user-ui .sm-button-size-large,
.sm-user-ui .sm-button-skin-default,
.sm-user-ui .sm-gallery-cover-slideshow-button:after {
content: "Slideshow";
margin-left: -40px;
}
Then the Icon appears.
So to keep the icon and the text, I replace the above with
.sm-user-ui .sm-button,
.sm-user-ui .sm-button-size-large,
.sm-user-ui .sm-button-skin-default,
.sm-user-ui .sm-gallery-cover-slideshow-button:after {
content: "Slideshow";
/* margin-left: -40px;*/
width: auto;
Note that I commented out the margin-left code. Otherwise the icon and the text overlap.
I would appreciate your thoughts. I do not know really what I am doing.
I suggest you look at this on different screen sizes then: http://quirktools.com/screenfly/#u=http://www.robertboire.ca/Portfolio2/Radiance/&w=1024&h=600&s=1
You may have to re-think your design.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Just a thought. If you want to center your Galleries titles, drag a title block on top of block that says "On ALL Galleries" and select 'Center' in the title section. Save it. Then you can hide the other title using CSS. Probably
.sm-user-ui .sm-gallery-cover .sm-gallery-cover-title {display: none;}
should do the trick.Just don't fill in the title. It will automatically fill the correct title.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk