473,748 Members | 9,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3894
in comp.infosystem s.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:b lock;margin:aut o;}
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:b lock;margin:aut o;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.individ ual.net>...
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@N 00&amp;count=1& amp;display=ran dom&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:100p x">
<script type="text/javascript"
src="http://www.flickr.com/badge_code.gne? nsid=65039038@N 00&amp;count=1& amp;display=ran dom&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.infosystem s.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;ma rgin-left:-20px;}
..foobar img {padding:3px;bo rder: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@N 00&amp;count=1& amp;display=ran dom&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.individ ual.net>...
in comp.infosystem s.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@N 00&amp;count=1& amp;display=ran dom&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.infosystem s.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote in message news:<MP******* *************** **@news.individ ual.net>...
in comp.infosystem s.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@N 00&amp;count=1& amp;display=ran dom&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.individ ual.net>...
in comp.infosystem s.www.authoring.stylesheets, Michael Kalina wrote:
Lauri Raittila <la***@raittila .cjb.net> wrote in message news:<MP******* *************** **@news.individ ual.net>...

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;ma rgin-left:-20px;}
..foobar img {padding:3px;bo rder: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
1822
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. For lists, I understand this: C= print C some But I can't seem to do this:
13
1935
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 far. Some of the photos won't work on the "new" site,
20
2697
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 this.
8
2557
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 and Long dates being displayed (including a DateTimePicker). BUT... at work, there are some machines which the Region is the ol' default of "English (United States)". Canadian:
17
3946
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 application in C++. I want to use 32-bit integers, and I want the application to be able to save it's state in a portable fashion. The obvious choice would be to use the "long" type, as it is deined to be at least 32 bits in size. However, the...
15
2117
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 problems with my proposed approach. Thanks in advance! See http://www.artima.com/weblogs/viewpost.jsp?thread=107587 For those who just want the code: template<typename target_type> class base_class_ptr {
14
12917
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 all obvious in VBA which lacks inheritance. I'm trying the explanation again now. I often find cases where a limited form of inheritance would eliminate duplication my code that seems impossible to eliminate otherwise. I'm getting very...
9
4190
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 integer or decimal part? For example, if in 8.24, should the macro be: #define Int2Fixed(x) (((long)(short)x) << 24)?
16
3468
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 have the following hashtable h which has multiple readers and 1 writer (on different threads) is this the correct locking below: lock (h.syncroot) {
5
3223
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 and FP15 for V8. Would changing the permissions on the db2dump directory so that only instance owner has access be enough?
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3315
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.