Right-indenting left-nav links that wrap
ChancyRat
Registered Users Posts: 2,141 Major grins
Moving this part to a thread on it's own subject. Yes, you nailed it exactly.
The pink shows two links that should left indent when wrapping.
While this is fixed could I also make the row height smaller? Not as much space between the lines? THANKS.
The pink shows two links that should left indent when wrapping.
While this is fixed could I also make the row height smaller? Not as much space between the lines? THANKS.
Also, I'm not sure what you mean by left indent. As in ... you want the 2nd line to be further to the right than the first line. So it would look something like:
Code:
Using a rattie shuttle with unsocializing rats
Instead of
Code:
Using a rattie shuttle with unsocializing rats
?
0
Comments
Note that the code applies to a specific type of navbar. AFAIR, Hikin' Mike adjusted it for my accordion style.
Thanks both of you very much.
I noticed comments about the plus and minus signs, and what I see is that:
1. The plus sign is very low down, almost on the bottom line. I can see the minus sign.
2. The plus sign is very sensitive. If the mouse is not dead square on it, I open the folder rather than opening the navbar sub-menu.
Any thoughts on left indenting the wrapping lines of long titles? I put pink on the bottom image to show the sections that should be further indented right.
Which font are you using? I like it.
Buda is the font.
I've got a bit of a quandry about it because while it showed fine at home, it didn't at work (with all browsers up to date).
I posted about it here: http://www.dgrin.com/showthread.php?t=241957.
I'm still not sure if the majority of the world will see Buda because of what happened to me at work.
Would you know if the google fonts are supposed to be fully operational for the world, automatically? Basically?
I had assumed they would work, but now that this is what's happenig to you, well... hmmmm...
Anyway, I don't have a clue.
You still never answered the question: what do you mean by "left indenting". I'm so confused. They're aligned on the left. Do you want it so that if the text doesn't fit in the width of the navbar and it is wrapped to a 2nd line, to have that 2nd line be pushed in to the right?
If so, all you need to do is add this to your navbar code (I'm not sure where exactly, since you haven't unveiled yet): Basically what this does is it the fist line to be moved to the left by 30 pixels. Then the 2nd line (padding-left) pushes the whole thing to the right by 35 pixels. What you end up with is the first one to the left by 5 px.
It's possible to move the + icon up: Note: I use this code to move the + icon on my MOBILE VERSION of my site. I haven't tested this on a non-mobile version so it may not work.
I hate the accordion, for what it's worth. It's a pain as you mentioned.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I may have discovered a new form of dyslexia, and victimized you with it. Sorry about that.
I attach an image, because I see DG strips my space indents on plain text.
This is for the left navbar that shows on the home page only.
Given that, I don't know where the code that you provided above, goes.
Unfortunately, I have another problem that I'll post in the next post so I can again attach an image.
I have these links and settings, which DO work on the top navbar (entire site except home page):
Main category link - set to not open folder contents
- Subfolder link- set to open folder contents
- Gallery
- Gallery
In this snapshot I put green pluses to show where they are missing. Pink is the indent right problem.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Yes.
It's possible this may change in the future, but at the moment, accordion-style menus are restricted to two levels (meaning any items below the second level will be saved with the content block but won't be shown on the published page). So, if you have a menu structure that has more levels than that, you'll need to change the menu to a vertical bar style, which will allow everything to show.
-Mike
(and an avid landscape photographer - view my website)
Oh, gotcha, thanks.... then, the only issue is the right-indenting for wrapping titles.
It is in the CSS of my main theme, and the navbar appears on the home page only:
This was the original code:
text-indent: -30px;/*this pulls the first line to the left*/
padding-left:35px;/*this pushes the paragraph to the right*/
I tried tweaking this -30 and 35, reversing the - and +, and also commenting out each of the lines, but none of these variations corrected the two pink sections in the image.
The two pink areas need to be indented further right (yes, really right). They are the 2nd and 3rd lines of links.
Otherwise they appear to be separate links.
A couple things to note:
- You'll need to customize the items in red based upon your text size. It may be too small of a number and you'll see your lines overlapping. Make it bigger to push the line height down.
- Changing the "line height" causes everything, including ones that fit in 1 row, to be much smaller. You have to add in the padding-top and padding-bottom to get the height of each accordion row to go back to what it was. Feel free to customize those as you require.
My original code for left indenting works perfectly. Please don't change it. Padding's cannot be negative, for what it's worth (margin's can).
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I did not change your code, although, there was another bit that had to do, I think, with enlarging the + and - signs? So here's what I have, below.
And the resulting image shows what's wrong. The 2nd and 3rd lines of a link are too far left. The pink should not stick out like that, but instead should be further indented right. I put blue bars to show where they should align.
I've read and re-read my use of left and right and think I got it all right.
I am so confused by what text-indent and padding-left mean, that no matter what values I assign, I can't get the right results. Thank you for explaining that negative values don't work in them.
The code I gave you should work perfectly. I even created a test page to test it out. You must be doing something wrong. Can you send me the HTML for the page? Go to "View Source", copy the HTML code and email it to me in a text file. Make sure you do it for the page that you're having problems with otherwise I won't be able to fix it.
Simple searches on google should help you understand the CSS codes.
For example, a Google search on "CSS text-indent" gets the following:
"The text-indent property specifies the indentation of the first line in a text-block." or "The text-indent CSS property specifies how much horizontal space should be left before the beginning of the first line of the text content of an element". You can even see examples here: http://css-tricks.com/almanac/properties/t/text-indent/
The padding-left description leads to some useful links that show you how margins and paddings take effect. Imagine your area is a box. Margin's effect the outside of the box -- you can push the box left, right, up, down. Paddings effect the inside of the box. In your case the thing you're working on is the "element" (or element box. So if your text is "Rats that like to play" that's your element. http://www.htmldog.com/guides/css/beginner/margins/
Basically what the code does is as follows:
- "Padding-left: 35px" pushes the entire text 35 pixels to the right. It effects the first, second, third, fourth, fifth, etc lines. EVERYTHING is pushed to the right. What it's saying is if my element starts here, at this line: "|", make my element start 35pixels after that. So you'd have "| WHATEVER TEXT".
- "Text-indent: -30px" pushes the FIRST line to the right by -30pixels. Since it's negative 30 pixels it really means "push the FIRST line to the left by 30 pixels". When you use it in conjunction with the first one you end up with: "Push everything to the right 35 pixels, but push the FIRST line to the left by 30 pixels." ... If you assume the 1st line is 'normal' ... you now have in other words is "Push the 2nd, 3rd, 4th, etc lines to the right by 5 pixels".
I don't know what you're doing wrong so sending me the HTML should allow me to fix it.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Thanks - but -
Do I apply this in addition to leaving this code in place:
Get rid of the old code. It will screw it all up if you don't.
We can restrict it to the left navbar only bad adding 1 extra set of restrictors (add ".sm-page-layout-region-left" before everything):
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I changed the hover color (great idea), but that is all.
Here's the code I inserted, copied out of my CSS. And as you can see, the 2nd and 3rd lines of each link are not indented further right than the first line of the respective links.
It looks like you entered the code wrong. You have an extra line at the top that I highlighted in red. Delete it I tested my code on your site, so I know it works :
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Almost there!
I tweaked one setting as so, which came closer to what I want (see image) - I think it tweaked the horizontal line spacing between the subcategories and galleries under a main category.
But what do I tweak to reduce two areas:
- pink is horizontal blank space between categories
- green is horizontal blank space between category and the sub-items under it.
And then how can I make the hover effect bold on the text, in addition to the wonderful hover color code?
EDIT: forgot the code:
Here's the code. I couldn't get the bold to transition (fade in). It also makes some of the lines go from 3 to 4 lines and looks weird. I wouldn't recommend implementing the bold on hover.
New stuff is in red. I added 2 new sections: the first makes the top level paddings smaller (less vertical space). Even though you made pink and blue marks in your previous post it's all the same issue -- too much padding on the bottom of the top menu link. I added a padding of 4px to the top and bottom because I thought that looked good. Feel free to tweak. I recommend keeping the padding-top and padding-bottom the same so that the text is properly centered. I set the line-height to 20px because that's the size of the font you use. If you change the font size you may want to change that "line-height".
In the 2nd set of new code I moved the + and - accordion buttons up ... changing the line height in the previous section screwed up the + and - buttons. Feel free to tweak the top: -6px; to whatever you need. Since it may be confusing, top means "Place this area <X> number of pixels from the top of the element." Basically that means "move it down by <X> pixels." By using a negative value, I'm telling it to move up by 6 pixels.
EDIT: As usual, either replace the previous code with this one, or add the parts in red.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I'm sure you're getting tired, I'm in disbelief at how complex this was.
But - I don't understand - "feel free to tweak the top"
What top?
-6 px? Is where?
Line height is in more than one place?
Yes, the + and -'s are still too low.
Otherwise this is GREAT.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Okay tell me I'm crazy but this code you refer to is not in the CSS. No can find "move the + and -..." or "-6px..."
Honest!
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
OMG. So Sorry. Didn't see that bit.
But - it didn't work. I changed it to -20px, then -2 (not sure what the "-" means). Nothing changed.
Just so I'm fully transparent, here's the code now: