473,395 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Borderline around non fixed-width images?

Hi!

On my website (http://michaelsremarks.blogspot.com) I use a so called
flickr-badge. That is some sourcecode that takes a picture out of my
flickr-gallery and puts it onto my website.

Now I would like the picture to have a border with a 3px (or so)
padding all around. The problems are:

a. If I do not input a fixed-width, like now 100px, the image is on
another position.
b. If the picture is not landscape-format (which is rather often), I
have more than 3px padding on the right side of the picture!

Just reload the homepage a few times and you see, what I mean.

Is there a solution for this problem?

Thanks, M.
Jul 21 '05 #1
8 3884
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Hi!

On my website (http://michaelsremarks.blogspot.com) I use a so called
flickr-badge. That is some sourcecode that takes a picture out of my
flickr-gallery and puts it onto my website.

Now I would like the picture to have a border with a 3px (or so)
padding all around. The problems are: a. If I do not input a fixed-width, like now 100px, the image is on
another position.
What do you mean? Where it should be? If in middle of right panel:

a {border:#999 1px solid;dispaly:block;margin:auto;}
img {margin:3px;}

<a><img></a>
b. If the picture is not landscape-format (which is rather often), I
have more than 3px padding on the right side of the picture!
What do you want?

Or maybe, in the middle of fixed box:
a {border:#999 1px solid;dispaly:block;margin:auto;width:100%}
img {margin:3px auto;}
Just reload the homepage a few times and you see, what I mean.

Is there a solution for this problem?


Yes. Problem is that I don't know what you wish.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #2
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.individual.n et>...
What do you want?


The picture on the sidebar, beneath "Aktuelles Bild" is "produced" by
this code:

<div style="padding:2px;margin:0 45px 0 0;border:solid silver
1px;width:100px">
<script type="text/javascript"
src="http://www.flickr.com/badge_code.gne?nsid=65039038@N00&amp;count=1&amp;d isplay=random&amp;name=0&amp;size=thumb&amp;raw=1" ></script>
</div>

Now the problem is that this picture not always is 100px wide. It also
can be only, say, 60px wide, but the CSS always produces a 100px-wide
box, no matter weather the picture is or is not 100px wide.

My question is: How do I have to change the code, so that it works
also with pictures that have another width than 100px?
Jul 21 '05 #3
On 30 Oct 2004 15:55:18 -0700, m.******@gmail.com (Michael Kalina)
wrote:
<div style="padding:2px;margin:0 45px 0 0;border:solid silver
1px;width:100px">
<script type="text/javascript"
src="http://www.flickr.com/badge_code.gne?nsid=65039038@N00&amp;count=1&amp;d isplay=random&amp;name=0&amp;size=thumb&amp;raw=1" ></script>
</div>

Now the problem is that this picture not always is 100px wide. It also
can be only, say, 60px wide, but the CSS always produces a 100px-wide
box, no matter weather the picture is or is not 100px wide.

My question is: How do I have to change the code, so that it works
also with pictures that have another width than 100px?


<div class="foo">
<script ...></script>
</div>

div.foo {
margin: 0 45px;
width: 100px;
text-align: center;
}
div.foo img {
border: solid silver 1px;
padding: 2px;
}

The border will now be around the image which will be centered in the
100px wide div.

Steve

Jul 21 '05 #4
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:
What do you want?
The picture on the sidebar, beneath "Aktuelles Bild" is "produced" by
this code:


..foobar {text-align:center;margin-left:-20px;}
..foobar img {padding:3px;border:silver 1px solid;}

Might not work on IE.

<div class="foobar"> <script type="text/javascript"
src="http://www.flickr.com/badge_code.gne?nsid=65039038@N00&amp;count=1&amp;d isplay=random&amp;name=0&amp;size=thumb&amp;raw=1" ></script>
</div>
I don't understand at all why are you using that script. I bet you don't
understand the script either. Using some simple server side code would be
much better.
Now the problem is that this picture not always is 100px wide. It also
can be only, say, 60px wide, but the CSS always produces a 100px-wide
box, no matter weather the picture is or is not 100px wide.
That is because you say width:100px;
My question is: How do I have to change the code, so that it works
also with pictures that have another width than 100px?


I am not exatly sure if you need to change that script, but it certainly
would be very good idea, as it writes incorrect and idiotic code.
It writes stuff like
<table cellspacing="0" cellpadding="4" ...>
<tr align="center">
And doesn't do anything at all, exept print urls that it gets from server
side thingy.

What is that script supposed to do? Why are you using it? Why it is
mostly bullshit? Where did you get it?

Have you noticed, that your code is horrible to look at?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #5
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.individual.n et>...
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:

<div class="foobar">
<script type="text/javascript"
src="http://www.flickr.com/badge_code.gne?nsid=65039038@N00&amp;count=1&amp;d isplay=random&amp;name=0&amp;size=thumb&amp;raw=1" ></script>
</div>


I don't understand at all why are you using that script. I bet you don't
understand the script either. Using some simple server side code would be
much better.
What is that script supposed to do? Why are you using it? Why it is
mostly bullshit? Where did you get it?

Have you noticed, that your code is horrible to look at?


Dear Lauri!

Sorry that my code offends your eyes, sorry that I, somebody who tries
to produce validating code, ask such questions in such an elite-group,
where somebody who is not a specialist in stylesheets seems not to be
welcome.

Yes, I have no clue what this javascript does, yes, I do not
understand it. It's a code I got from the flickr-service
(http://flickr.com) to show some random image of my pictures on my
homepage, which is also taken from blogger (http://blogger.com) and
which's code is written by Dan Cederholm (http://www.simplebits.com/),
who seems to be a specialist in this...

Of course, it would be more easy for me to just input the code I got
from flickr, let the thing be working and that's it. A lot of people I
know are doing this. But no, I try to ask in the html- and
stylesheet-group how to produce validating code, because I thing that
this is the least thing I can do to support some standards... Usually
I learn out of the answers I get and the next time I can do a solution
for myself, not asking the experts in the html- or stylesheet-groups.

But what happens? Reading answers that express nothing else than "What
do you want, go away, let us alone?!!!" (especially from you!) is not
funny, not useful and for somebody who really has no clue of
professional coding, it's disappointing.

My word on it...

M.
Jul 21 '05 #6
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.individual.n et>...
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila.cjb.net> wrote in message news: <div class="foobar">
<script type="text/javascript"
src="http://www.flickr.com/badge_code.gne?nsid=65039038@N00&amp;count=1&amp;d isplay=random&amp;name=0&amp;size=thumb&amp;raw=1" ></script>
</div>


I don't understand at all why are you using that script. I bet you don't
understand the script either. Using some simple server side code would be
much better.
What is that script supposed to do? Why are you using it? Why it is
mostly bullshit? Where did you get it?

Have you noticed, that your code is horrible to look at?


Dear Lauri!

Sorry that my code offends your eyes,


I makes debugging of your site very hard, and you asked help. Offending
my eyes is irrelevant. (Very good sites with easily debuggable code may
hurt my eyes, as I don't like capitalized tags - but that is totally
irrelevant, unless someone asks)

In first reply, I ddin't even look at your code very carefully, because
it was so un readable, and I thought you would know basics of CSS and
HTML. So I didn't know you used some clueless script instead some clueful
script.
sorry that I, somebody who tries
to produce validating code, ask such questions in such an elite-group,
where somebody who is not a specialist in stylesheets seems not to be
welcome.
Don't take it personally. If you take newsgroup messages personally, you
are stupid. (now, if you read that to mean that you would be stupid, you
are stupid. You are not stupid, but the JS you used sure is.)
Yes, I have no clue what this javascript does, yes, I do not
understand it. It's a code I got from the flickr-service
(http://flickr.com) to show some random image of my pictures on my
homepage, which is also taken from blogger (http://blogger.com) and
which's code is written by Dan Cederholm (http://www.simplebits.com/),
who seems to be a specialist in this...
The JS it wrotes it complete bullshit. The random image thing irrelated
to that JS. I was unable to find the script on those
Of course, it would be more easy for me to just input the code I got
from flickr, let the thing be working and that's it. A lot of people I
know are doing this.
Well, what is that code? Is it hard to believe it would be worse than JS
you have now. Or is that JS the code? Do flickr give you options about
code (can you use some other?)
But what happens? Reading answers that express nothing else than "What
do you want, go away, let us alone?!!!"
I never said let us alone. I did ask what do you want, because I didn't
know what you wanted. Is it too hard to get that it is impossible to give
answer if it is not known what you aim.

In the first message, I gave you 2 generic code examples on about how to
do it. You never commented them. In my second post, I give you one ugly
hack, which would allow you to use your horrible JS. If you don't
understand my advice, and can't ask what I mean with it, you better not
give me bullshit.

If your code would have been more sensible, it would be easy to give you
even more different ways to do it. But you are using one cell table with
invalid attributes, which makes styling much harder. The fact that you
did not know you used table layout doesn't take it away.

Validation is just tool, it does not for example get invalid code
generated by JS.
(especially from you!)
I gave you some CSS to make it look somehitng that I *guessed* you want
it to look. You didn't say, if you want you box in center, or image
centered in box, or box left edge in same place, or boxes right edge in
same place, etc, etc.

It is very hard to help you make something look like something, If you
don't know what it should look.

The JS also prints all kinds of stuff that make make using styles very
hard. Which is why neither of 2 different codes I gave you work.
is not
funny, not useful and for somebody who really has no clue of
professional coding, it's disappointing.


I have given you 3 different way to do what I think you want. You have
not understood any of them. So instead actually asking why none of them
work, you ´give me bullshit about me mentioning your invalid code
generated by script you don't understand.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #7
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.individual.n et>...
in comp.infosystems.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila.cjb.net> wrote in message news:<MP************************@news.individual.n et>...

I have given you 3 different way to do what I think you want. You have
not understood any of them. So instead actually asking why none of them
work, you ´give me bullshit about me mentioning your invalid code
generated by script you don't understand.


"Bullshit" seems to be the word that suits your needs.

However, in the meantime I got a solution for what I need. Thanks to
Steve Pugh.

Of course, your advice to make the code look better, is also in the
works, but I cannot - and that's really a pitty - change some parts of
the code as it is being inserted by the provider/hoster, namely
Blogger.

Maybe I'll move to another hoster or just see, how I can get around
it.

Thanks for the help, anyway.
Jul 21 '05 #8
On 2 Nov 2004 00:10:36 -0800, m.******@gmail.com (Michael Kalina)
wrote:
"Bullshit" seems to be the word that suits your needs.

However, in the meantime I got a solution for what I need. Thanks to
Steve Pugh.


Huh?

My solution:

div.foo { margin: 0 45px; width: 100px; text-align: center;}
div.foo img { border: solid silver 1px; padding: 2px; }

Lauri's solution:

..foobar {text-align:center;margin-left:-20px;}
..foobar img {padding:3px;border:silver 1px solid;}

Almost identical. I think you should be more careful.

Steve

Jul 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Matthew Sims | last post by:
Python Newbie here. This is my first time learning object-oriented programming and trying to break out of the usual Korn/Perl/PHP style of programming. Having some difficulty understand some items....
13
by: Greg G | last post by:
Present site: http://www.risky-biz.com First "sketch" of new design. http://www.risky-biz.com/new I'm trying some new ideas, mostly just changing the stylesheet. It's pretty rough so...
20
by: Joe exCSSive | last post by:
Hi, folks: I'm back...and now I'm really stuck !! I have a graphic ( http://www.sundialontario.com/images/makeitatable.jpg ) that I would like to convert to CSS and I'm not sure how to do...
8
by: JamesBV | last post by:
My PC's Region setting is set to "English (Canada)"... cause I am in Canada (eh?) (: I'm using VB.net, standard edition (v1?) So I wrote my application based on this Region. I've both Short...
17
by: Adam Ierymenko | last post by:
I have a question that might have been asked before, but I have not been able to find anything via groups.google.com or any web search that is definative. I am writing an evolutionary AI...
15
by: christopher diggins | last post by:
I posted to my blog a special pointer class work-around for inheriting from base classes without virtual destructors. I was wondering if there is any other similar work, and whether there are any...
14
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at...
9
by: pout | last post by:
What are the purposes of fixed-point? When should it be used? I read: #define Int2Fixed(x) (((long)(short)x) << 16) and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to...
16
by: akantrowitz | last post by:
In csharp, what is the correct locking around reading and writing into a hashtable. Note that the reader is not looping through the keys, simply reading an item out with a specific key: If i...
5
by: Norm | last post by:
Does anyone have any suggestions for securing against this vulnerability: http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-1027 Fixes are not yet available from IBM. They will be in FP2 for V9...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.