Hi there jackmoskovita i like your approach and style, my only thing what would i suggest is to use flexbox or even more css grid if you have not used, plus a little bit css transition which is not that hard only one line of code and you can make when you hover the images a cursor pointer and larger images.
That is my recommendation out of your topic, but I like your work
Thanks
There is no need for those as the example works fine as it is (and almost everywhere).
To be honest though I would also generally say to use flexbox but in this case we are dealing with fixed sizes so there is no need to flex anything and indeed flex would make this slightly more awkward if you didn’t know what you were doing. Grid could also be used but there’s no need to grab the latest and greatest property in the toolbox when existing tools do the job nicely.
However if modern browsers support only is needed then you can mostly avoid inline-block and use flex instead (or use inline-block as a fallback).
Where do you place the JS at? In Header or in Main?
Also, do I put that code inside script tags?
I also noticed that the main large photo at the top now has a black border?
No the JS should go in a script tag at the bottom of the html before the closing body tag (or in an external referenced script at the same place).
e.g.
<script>
//the script goes here
</script>
<!-- Just before the closing body tag of your page -->
</body>
</html>
Note that I added a new id t the mast for easy reference although I guess you should really be copying al the html as I tidied it up.
Yes as mentioned above. Codepen has special panels so you don;t need to add the script or style tags when you place code in the correct pane. Also in codepen you generally only include code that is inside the body of the html and put head stuff in the settings tab if needed (but generally you don’t need head stuff for a codepen demo except to links to necessary external files).
Yes I was playing around with that as I felt it looked better when you had a smaller image showing and there were gaps at the side. As you have not kept all your images to the same aspect ratio the image size would change but I used object-fit:contain on the image to keep it within the initial large image size. That means that tall images will be constrained to the height available and their width will be reduced according to their aspect ratio.
Firstly I used object-fit:cover which made the image cover the whole area but that would result in some cropping and indeed some of your bird pictures would lose their heads Therefore I felt it better to contain the image within the available space but to have the black background behind. In my opinion this looked much better but of course you can just remove the border and background if you don’t like it.
Then the “span.set” ruleblock to change line-height could be removed in the media rule:
@media screen and (max-width: 980px) {
.photo ul.topic li span.set br {
display: block;
}
}
I thought the lack of vertical alignment with the line breaking tabs was a bit annoying but didn’t realize how easy it was to fix until I read the flexbox reminder above.
Hi erikfox87, welcome to the forum!
Thanks for reminding of flexbox.
I agree with Paul here but never the less I found a use for it regarding the tab texts horizontal and vertical center alignment.
The Website is looking really good. A couple areas of improvement I have in mind, but don’t know how to implement them, one is I find it irritating when I place the mouse cursor over like say the tab, “Bald Eagles” if I move the cursor wrong, it jumps back to the “active” Mountain & Lakes tab. I get complaints about that but don’t know how to fix it? How do I get it to stay on “Bald Eagles” no matter where the mouse cursor is? https://moskovita-photography.com/
What you mean is how do you get it to stay on “Bald Eagles” unless you hover over any of the other top row tabs.
This can only be done in JS if you are talking about a hover activating the tab and keeping it constant until another top tab is hovered. The usual method is to add a class (using JS) to the tab when you hover over it and use that class to keep the submenu open (much in the same way that the hover rules keep the menu open. Indeed you would use the same code and just add an active class into the mix). When the user hovers another tab then you take off the class from the previous tab and apply it to the newly hovered tab, The CSS takes care of the rest
I’ll try and knock up a demo this afternoon to show the method. As this is an enhancement then JS is perfect for this as the menu still works without JS.
Just for fun I changed the thumbnails to horizontal scrolling for small screen as it was impossible to use on a mobile as you had to scroll all the way down the page and then all the way back up to see the image.
Okay, what am I doing wrong? I copied the script and replaced the one currently at the bottom of webpage right above body></html
Nothing changed?
If this works I’m thinking making a separate page of this and of adding a button on main index page saying something like this “For CELL Phones”.
I was testing the above script here: https://moskovita-photography.com/Jack-Moskovita-Photography_Test.htm
The css was also changed so you need to copy that as well.
You don’t need to add a button for small screens as they will get the display automatically due to the media queries. That’s what responsive design is about
It doesn’t show up in yours. This is where I’m seeing it so you can check to see if I messed up on the code somewhere: https://moskovita-photography.com/