adding pictures to the weatherstyle.css
Posted: Sun 06 Feb 2011 8:01 am
I've previously added my own photo. That was fine. Now I want to add multiple photo's, left and right in the style sheet. How do I do that?
Support forum for Cumulus weather station software
https://cumulus.hosiene.co.uk/
Code: Select all
<body>
<table width="100%" height="100%">
<tr>
<td align="left" class="section">
<img src="image1.jpg" alt="image1" />
</td>
<td class="section">
your central content here
</td>
<td align="right" class="section">
<img src="image2.jpg" alt="image2" />
</td>
</tr>
</table>
</body>
Code: Select all
td.section {
vertical-align:top;
}So that would put a picture either side? And would this only effect the page that the html was added in. I'm not sure where I should put the css code in the stylesheet. I'd be looking at putting about 3 photo's down each side for all of my pages.DaveNZ wrote:I would do it in the following way: lay my site out in table format.
And the css for sectionCode: Select all
<body> <table width="100%" height="100%"> <tr> <td align="left" class="section"> <img src="image1.jpg" alt="image1" /> </td> <td class="section"> your central content here </td> <td align="right" class="section"> <img src="image2.jpg" alt="image2" /> </td> </tr> </table> </body>Some would choose to do it with divs, but I have never had much luck with getting those to align the way I want.Code: Select all
td.section { vertical-align:top; }
It would put a picture either side, yes. But it would only affect one page, and using the cumulus template you would have to edit every web page if you wanted it on all pages. Using php it would be easier.MickinMoulden wrote: So that would put a picture either side? And would this only effect the page that the html was added in. I'm not sure where I should put the css code in the stylesheet. I'd be looking at putting about 3 photo's down each side for all of my pages.
Code: Select all
<link href="weatherstyle.css" rel="stylesheet" type="text/css" />
<style type="text/css"> body { background-image: url("myimages/statusbackground.png") } </style>
Yes, I don't think there is anyway around it at the moment. Think I might use the float technique in CSS like this:DaveNZ wrote:I would think 3 photos down each side using CSS wouldn't be possible without adding extra html elements into your web pages.
Code: Select all
img.floatRightClear {
float: right;
clear: right;
margin: 4px;
}
Code: Select all
<body>
<img src="sunset.gif" class="floatRightClear">
<img src="sunset2.gif" class="floatRightClear">
</body>
You could try it, and also add the following to your image styles. This will make sure any text flows over the top of the images instead of underneath.MickinMoulden wrote:Seems to be alot of ways to do it heyCode: Select all
<body> <img src="sunset.gif" class="floatRightClear"> <img src="sunset2.gif" class="floatRightClear"> </body>![]()
Code: Select all
z-index:-1
I was looking at this the other day. Looks like heaps of new features. Barely any browser support for most of it yet thoughsteve wrote:I think CSS 3 will make all this a lot easier. Not much help now, though...
Yup, already done the tag (see my site), works to.Synewave wrote:I'm by no means a CSS expert, but one method I use on my status page to override the background picture coded in the css is:You could code a <#webtag> in the picture filename, i.e. to change the picture if it was day or night using the <#isdaylight> tag.Code: Select all
<link href="weatherstyle.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-image: url("myimages/statusbackground.png") } </style>
is just one picture file?url("myimages/statusbackground.png")
Yes, it is just an animated gif, so essentially one file.MickinMoulden wrote:Yup, already done the tag (see my site), works to.Synewave wrote:I'm by no means a CSS expert, but one method I use on my status page to override the background picture coded in the css is:You could code a <#webtag> in the picture filename, i.e. to change the picture if it was day or night using the <#isdaylight> tag.Code: Select all
<link href="weatherstyle.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-image: url("myimages/statusbackground.png") } </style>
Yours is real nice, that's where I got the idea of changing pictures, but to change to the current weather conditions.
So your code is in the HTML on all pages. But how do they change. Is png like a gif so that theis just one picture file?url("myimages/statusbackground.png")
Yes, as I've already mentionedtjaliwalpa wrote:Here is another possibility which uses the body and allows the images to swap and be in a set position. It is closer to what you wanted to do in the first place.
Creat images temp_00.jpg (image you want for no alarm), temp_01.jpg (image you want for high alarm)and temp_10.jpg Image you want for low alarm). Use the tags to create the names like this:
body {
background-image: url("images/temp_<#lowtempalarm><#hightempalarm>.jpg");
background-repeat: no-repeat;
background-position: 0% 0%;
}
The background-position allows you to place the image where you want on the screen in relation to the top left of the screen (or frame).
, and have been discussing this with Dave in another thread, but thought it would be better suited here.Yup, already done the tag (see my site), works to.
OK....tried it this way, but I've stuffed it up big time.... The photo's on the other hand look great and do excactly what I want. There are a total of 17 photo's, and display depending on the weather at the time of the upload. As it's 01:30, I'm going to have to leave it in the mess that it's in and try something later.DaveNZ wrote:I would do it in the following way: lay my site out in table format.
And the css for sectionCode: Select all
<body> <table width="100%" height="100%"> <tr> <td align="left" class="section"> <img src="image1.jpg" alt="image1" /> </td> <td class="section"> your central content here </td> <td align="right" class="section"> <img src="image2.jpg" alt="image2" /> </td> </tr> </table> </body>Some would choose to do it with divs, but I have never had much luck with getting those to align the way I want.Code: Select all
td.section { vertical-align:top; }