1 samredman Apr 26, 2007 01:52
3 john Apr 26, 2007 02:21
Why don't you just give the gallery an ID eg: wrap it in a div called #gallery
Then simply have #gallery ul and #gallery li etc etc
That way it won't clash with other list elements tha may already exist in your b2 style sheets.
4 samredman Apr 26, 2007 05:22
Great progress. I am now showing a gallery of sorts, as you can see here in the blog demo I have set up.
http://samredman.com/blogdemo/index.php?blog=3
While it does show a thumbnail gallery and hovering does produce some effect. It still is not achieving the look I have in my example webpage, which is my objective (link follows). In the blog post, it is missing the borders around the thumbnails and there is no white space separation. This is what I am trying to achieve:
http://www.samredman.com/b2example/cssmenu/
Here is the addition I made to a skins styles.css file:
/* start div gallery */
.gallery a:hover {background-color:#F7DFC6}
.gallery a {
float:left;
width:6em;
text-decoration:none;
color:white;
background-color:B59629;
padding:0.2em 0.6em;
border-right:1px solid white;
}
.gallery ul {
float:left;
width:100%;
padding:0;
margin:0;
list-style-type:none;
}
.gallery li {display:inline}
.gallery img {
border: none;
width: 120px;
height: 90px;
float: left)
/* end div gallery */
What do I need to add or change in that css to accomplish what I have on that webpage? I think I have all of the css I was using there in the styles.css (you can see my webpage css in my earlier post).
The following is my posting in the blog:
<div class="gallery">
<ul>
<li><a href="http://samredman.com/b2example/images/nature1.jpg" target="_blank"> <img src="http://samredman.com/b2example/images/nature1.jpg" alt="nature scene" title="nature scene - shows in new window"/> </a> </li>
<li><a href="http://samredman.com/b2example/images/nature2.jpg" target="_blank"><img src="http://samredman.com/b2example/images/nature2.jpg" alt="interesting pic" title="Click here to view interesting picture - shows in new window" /></a> </li>
<li><a href="http://samredman.com/b2example/images/nature3.jpg" target="_blank"><img src="http://samredman.com/b2example/images/nature3.jpg" alt="interesting pic" title="Click here to view interesting picture - shows in new window" /></a> </li>
</ul>
<ul>
<li><a href="http://samredman.com/b2example/images/nature4.jpg" target="_blank"><img src="http://samredman.com/b2example/images/nature4.jpg" alt="interesting pic" title="Click here to view interesting picture - shows in new window" /></a> </li>
<li><a href="http://samredman.com/b2example/images/nature5.jpg" target="_blank"><img src="http://samredman.com/b2example/images/nature5.jpg" alt="interesting pic" title="Click here to view interesting picture - shows in new window" /></a> </li>
<li><a href="http://samredman.com/b2example/images/nature6.jpg" target="_blank"><img src="http://samredman.com/b2example/images/nature6.jpg" alt="interesting pic" title="Click here to view interesting picture - shows in new window" /></a> </li>
</ul>
</div>
In the html... I did not have to close the <li> tags but in the b2evolution, an error display demanded that they be closed. I don't know if that is relevant to the solution or not.
5 afwas Apr 26, 2007 07:54
Nicely done.
You missed one charachter:
background-color:B59629;
should be
background-color: #B59629;
You could do this color thing also with the border property. There is, amongst others, border-color and border-style. See [url=http://www.w3schools.com/css/css_border.asp]w3schools.com[/url].
Have fun
6 samredman Apr 26, 2007 08:36
Thanks Afwas... that missing character did improve it (of course)...
Take a look now...
http://samredman.com/blogdemo/index.php?blog=3
You can see that it's better with the background color... But I still need to get separation between the thumbnails side by side and between the rows. I wonder if there is something I could put in the post to cause a line break or two? (I tried <br> but the error trapping says no to that).
Then the separation between the thumbnails.. that's a puzzle. I'll bet ¥åßßå will have a trick up his sleeve.
7 yabba Apr 26, 2007 08:42
You might like to go take a look at Scotts [url=http://randsco.com/index.php/2006/04/10/photo_caption_zoom_version_3]PhotoZoom[/url] .... we even have a plugin for it somewhere ;)
¥
8 afwas Apr 26, 2007 08:54
add
margin-right: 10px;
to both the ul and the a in the css.
Delete the <br> and the <p> between this two rows in the HTML. If you need addiyional space between the lines, add:
margin-bottom: 10px;
to both the ul and the a in the css.
Experiment. You can also use margin (all four sides) and margin-top and margin-left.
9 samredman Apr 26, 2007 08:57
Ok... I fixed it (with that tip to go look at the w3schools...
border-style: solid;
border-right-color: #ff0000
border-right-width: 15px
Plus... I will continue to experiment with thos ¥åßßå suggestions... thanks to all.. this is a going to be very nice simple gallery. I did take a look at the zoom a while back.. but it just quivered all over the place. So, I thought I would just like to have something very very simple.
10 afwas Apr 26, 2007 09:01
This little magic trick changes the colour of the border when hoover:
a:hover img{
border-color: #F7DFC6;
}
11 yabba Apr 26, 2007 09:02
You might like to take a look at it in FF ;)
¥
12 samredman Apr 26, 2007 09:05
Thanks so much for the help from everyone.. I am going to bed now (2:00 am) and will play with this tomorrow to get it really nice... y'all have given me several more things to try... but I am quite excited, it is actually very usable now..
With the latest tweaks.. it's looking the same in FF as IE. I just checked.
13 yabba Apr 26, 2007 09:10
If this is the url [url=http://samredman.com/blogdemo/index.php?blog=3]http://samredman.com/blogdemo/index.php?blog=3[/url] then it still looks like my screenshot in FF2
¥
*edit*
Try this :
/* start div gallery */
.gallery a:hover {background-color:#F7DFC6}
.Zoom a { padding:0; }
.gallery a {
display:block;
text-decoration:none;
padding:0.2em 0.6em;
color:white;
background-color:#B59629;
}
.gallery ul {
padding:0;
margin:0;
list-style-type:none;
}
.gallery li {
float:left;
padding:1px;
}
.gallery img {
border: none;
width: 120px;
height: 90px;
)
14 samredman Apr 26, 2007 17:45
Thanks.. ¥åßßå that certainly fixed it (and what is crazy is that I did see that other display and was willing to accept that as ok, even though it wasn't my original objective... shows you how sleepy I was)... but now with your code correction, it's showing those thumbnails correctly.
I have one new problem now... (I'm sure it's minor). I need a line break (or maybe some adjustment in that "li" float code) to separate them properly in rows... I am getting three on the first row two on the second flush right and one on the third row flush left.
Here is a screen capture of that "alignment" problem:
http://samredman.com/b2example/images/example1.jpg
Once that "line break" formatting problem in the post is solved, this will produce a very nice simple gallery.
15 afwas Apr 26, 2007 18:04
Add margins. From the looks of it into the .gallery a { declaration.
.gallery a {
margin: 5px;
...
...
16 afwas Apr 26, 2007 18:10
Don't do the linebreak hardcoded. Remove all <br /> and <p>.
The images will flow automagically to the next row. What happens in your example is the automaggically linebreak after pic 3, then the hardcoded stuff resulting in whitespace, then two pics, then an automagical linebreak and then the last picture.
17 samredman Apr 26, 2007 18:33
Ok.. I added that margin: 5px; (later changed that to 2px)to the a element. Plus, I removed all the break stuff... and it did look nicer (better space between)...
But, the same problem of bad alignment was still there.
However, I found a "fix."
I added a non-breaking space " " just prior to the termination of the a element like this, " </a>" and
that fixed it.
Here is how it looks now:
http://samredman.com/blogdemo/index.php?blog=3
Notice, also that I created another post with just text and no images (but, still with links to the images), utilizing the same new div gallery class (it's the second post on the page). That makes a nice menu effect in a post (something someone was asking about a while back).
18 afwas Apr 27, 2007 01:24
Well done.
Your solution uses the <ul> which is not neccesary (it isn't a list). I came up with this one without:
<style type="text/css">
img.galery{
border-style: groove;
border-width: 12px;
border-color: #B59629;
height: 90px;
width: 120px;
}
a:hover img.galery{
border-color: #F7DFC6;
}
and the XHTML:
<div id="galery">
<a href="../images/nature1.jpg" target="_blank"><img src="../images/nature1.jpg" alt="nature scene" title="nature scene - shows in new window" /></a>
.. more images
</div>
As you can see I style the images, where you style the unordered list.
19 samredman Apr 27, 2007 06:56
Afwas... I can see where styling the image is perhaps a good approach.
I'm going to stick with what I've got now... because it's working. But, even my ul method could probably use some tweaking.
You can either put the css in an existing stylesheet or create a new one. If you create a new one, you should add it to the _main.php file, like this:
in the <head> section.
Now you have two different <ul>'s with different style. You can achieve that by naming them different. You should use a class:
In your HTML.
In your stylesheet you must name them also:
This way there is no conflict in styles.
You can also do a lot of image styling in your css like so:
and your image in the HTML:
Good luck.