Images in css vs images in html
Is there any benefit over placing an image (which will be used in a template, so all pages on the site), as a background image on the css stylesheet as opposed to having it on the html in each page?
Example:
CSS:
#logo {
background: url(logo.jpg) no-repeat;
or
HTML:
<div id="logo">
<img id="logo" src="logo.jpg" width="13" height="13" alt="logo" />
</div>
Thanks
Jules
It all depends on how the image will be used.
If it will be a background for other content, put it in your CSS file.
If it will be an active link and you want it to contain alt attributes for better web accessibility, put logo image in your HTML.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
Similar Messages
-
By saving for web text-layer becomes a image in HTML what is wrong?
By saving for web text-layer becomes a image in HTML what is wrong? In this way I can not use CSS in the editor.
Right click on the layer, Duplicate Layer, set destination to the other image file in the dropdown.
-
I would like to know how to stretch a background image using HTML
Hello Seniors of Sun,
I gota small doubt in HTML, can any one please help me in solving it,
I would like to know how to stretch a background image using HTML? I have tried and tried to figure this out and cannot..
so any one kindly help me in this...
waiting for reply...Please note that this is not an HTML forum.
You can use an image tag on a DIV positioned behind the rest of the page, so that could actually work. And if you want to use body:background, then look up an HTML/CSS reference and see if there are any other body attributes or CSS stuff that applies to the background image. -
How do I keep an image or HTML item permanently centered?
I have been using Muse for a few months, but haven't figured out how to keep an image or HTML item centered regardless of the re-sizing of the browser window. Essentially I would like to 'Pin' the object not to one of the sides, but directly in the center and have it remain centered no matter what.
I had a digital conversation with a Muse representivtive and they suggested I use the align function and then lock the item, but I was unable to make this work in the desired manner and they left the conversation before anything was resolved.
http://kanyewest.com is a perfect example of what I am trying to do.
http://young--man.com is my website. For example, I would like to hard center the html object (YouTube video).
Any help would be greatly appreciated. Thank you in advance.try this code
CSS
.exactCenter {
width:200px;
height:200px;
position: fixed;
background-color: #00FF00;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -100px;
HTML
<div class="exactCenter">
</div>
full source code..http://www.corelangs.com/css/box/center-div.html
More about css positioning...
http://www.corelangs.com/css/box/positioning.html
George -
Re: [iPlanet-JATO] Tomcat 3.2 serving images and html?
First of all David you are faster responding to email than I am. Thanks.
We tried your scheme with no luck. You are using "ROOT" as your war file
name ROOT, correct? Are you sure the jsp would reference
"/images/MyProject/nppnback.gif"? Why is "MyProject" in there? Where is
the directory "images" defined to Tomcat? Is it a default?
Here's another try at explaining:
In my JSP I have;
<IMG SRC="/images/ef.gif" ALT=People Banner">
My application is in webapps/EformsAppWar
(jsps in EformsAppWar/EformsApp/eforms/*.jsp)
(classes in EformsAppWar/WEB-INF/classes)
so images are in webapps/EformsAppWar/images
and there is, indeed a ef.gif there.
However with no server.xml changes (everything default), Tomcat 3.2
gives a 404 in his log and states in the 404 message that context is
null (CTX < >) and ca't find /images/ef.gif + NULL.
By the way I just noticed that in Tomcat 3.1 I have the images directory
directly under webapps.
----- Original Message -----
From: "David J.L. Martin" <<a href="/group/SunONE-JATO/post?protectID=114166018056146134184102046176231239071179066034">dave@t...</a>>
Date: Wednesday, May 23, 2001 3:35 pm
Subject: Re: [iPlanet-JATO] Tomcat 3.2 serving images and html?
This works:
If the doc root is webapps\ROOT --
Using defaults...jsp's would be put in
webapps\ROOT\MyProjectApp\MyProject\*.jsp
and images would be put in webapps\ROOT\images\*.gif
Then in your jsp...use the following reference:
"/images/MyProject/nppnback.gif">
That will work just using defaults and not playing with any of the
config files...
ie. webapps\ROOT\WEB-INF gets updated as well (with required
classes).
djm
TechPie
916 924-1832 (office)
916 730-4743 (mobile)
916 313-3531 (fax)
<a href="/group/SunONE-JATO/post?protectID=114232044112042209130232046248130100239179057215113109152006048067">dmushrush@e...</a> wrote:
Many of you are running Tomcat 3.2. Can anyone tell me how to get
images to be served by Tomcat. In 3.1 if I referenced /images/image.gif> in my JSP, I could just place the images
directory in the application
(context) directory.
The default docBase is webapp> that webapp> relative addressed as /images/image.gif but such is not the case.
I have put the images directory almost everyplace possible with no luck.
I have explicitly defined docBase in tomcat/conf/server.xml and still no
luck.
I currently have the following in conf/server.xml
<Context path="/EformsAppWar"
docBase="c:/tomcat/webapps/EformsAppWar"
crossContext="true"
debug="0"
reloadable="true" >
</Context>
I place images in that directory structure but still take 404's and in
the log it refers to context as /images ????
I'm probably doing something (or not doing something) foolish. Anybody> have a remedy.
<a href="/group/SunONE-JATO/post?protectID=210083235237078198050118178206047166215146166214017110250006230056039126077176105140127082088124241215002153">[email protected]</a>
<a href="/group/SunONE-JATO/post?protectID=210083235237078198050118178206047166215146166214017110250006230056039126077176105140127082088124241215002153">[email protected]</a>First of all David you are faster responding to email than I am. Thanks.
We tried your scheme with no luck. You are using "ROOT" as your war file
name ROOT, correct? Are you sure the jsp would reference
"/images/MyProject/nppnback.gif"? Why is "MyProject" in there? Where is
the directory "images" defined to Tomcat? Is it a default?
Here's another try at explaining:
In my JSP I have;
<IMG SRC="/images/ef.gif" ALT=People Banner">
My application is in webapps/EformsAppWar
(jsps in EformsAppWar/EformsApp/eforms/*.jsp)
(classes in EformsAppWar/WEB-INF/classes)
so images are in webapps/EformsAppWar/images
and there is, indeed a ef.gif there.
However with no server.xml changes (everything default), Tomcat 3.2
gives a 404 in his log and states in the 404 message that context is
null (CTX < >) and ca't find /images/ef.gif + NULL.
By the way I just noticed that in Tomcat 3.1 I have the images directory
directly under webapps.
----- Original Message -----
From: "David J.L. Martin" <<a href="/group/SunONE-JATO/post?protectID=114166018056146134184102046176231239071179066034">dave@t...</a>>
Date: Wednesday, May 23, 2001 3:35 pm
Subject: Re: [iPlanet-JATO] Tomcat 3.2 serving images and html?
This works:
If the doc root is webapps\ROOT --
Using defaults...jsp's would be put in
webapps\ROOT\MyProjectApp\MyProject\*.jsp
and images would be put in webapps\ROOT\images\*.gif
Then in your jsp...use the following reference:
"/images/MyProject/nppnback.gif">
That will work just using defaults and not playing with any of the
config files...
ie. webapps\ROOT\WEB-INF gets updated as well (with required
classes).
djm
TechPie
916 924-1832 (office)
916 730-4743 (mobile)
916 313-3531 (fax)
<a href="/group/SunONE-JATO/post?protectID=114232044112042209130232046248130100239179057215113109152006048067">dmushrush@e...</a> wrote:
Many of you are running Tomcat 3.2. Can anyone tell me how to get
images to be served by Tomcat. In 3.1 if I referenced /images/image.gif> in my JSP, I could just place the images
directory in the application
(context) directory.
The default docBase is webapp> that webapp> relative addressed as /images/image.gif but such is not the case.
I have put the images directory almost everyplace possible with no luck.
I have explicitly defined docBase in tomcat/conf/server.xml and still no
luck.
I currently have the following in conf/server.xml
<Context path="/EformsAppWar"
docBase="c:/tomcat/webapps/EformsAppWar"
crossContext="true"
debug="0"
reloadable="true" >
</Context>
I place images in that directory structure but still take 404's and in
the log it refers to context as /images ????
I'm probably doing something (or not doing something) foolish. Anybody> have a remedy.
<a href="/group/SunONE-JATO/post?protectID=210083235237078198050118178206047166215146166214017110250006230056039126077176105140127082088124241215002153">[email protected]</a>
<a href="/group/SunONE-JATO/post?protectID=210083235237078198050118178206047166215146166214017110250006230056039126077176105140127082088124241215002153">[email protected]</a> -
In Mail 3.6 remote images in HTML messages display as blue squares with ? even though checked in viewing references.
Nurit,
The point is that that button should not be there, if the preference setting is as you say. This indicates the preference setting is stuck, and that is what I was trying to help you resolve.
The full purge is done as follows:
Quit Mail, and in the Finder open Home/Library and locate the Mail folder. Control-click over the Mail folder, and choose Duplicate -- then drag the resulting copy to the Desktop for temporary backup. Next, open Home/Library/Preferences and find the com.apple.mail.plist file and drag it to the desktop.
Relaunch Mail, which will open as though new, and when prompted to import anything DECLINE. Instead, re-enter your account info, and Mail will re-discover the account folders for your accounts, and all should be well, after setting preferences as you desire.
Ask any needed questions, and keep us posted.
Ernie -
I was recently sent an email that used an HTML stationery wih several photos embedded in it. The email opens normally, but all of the images are icons, displaying file name and size. If I click the icon, the image opens correcly in a separate window.
I am running OS X 10.7.3 and Mail 5.2 (1257) and have checked "display remote images in html email" in preferences. A friend with identical software versions receives the same email and the photos are visible in the original email. Suggestions?No-one replied, but I found a solution on another board. Run Terminal (do a Spotlight search if you don't know where to find this), and type: (or copy and past the next line)
defaults write com.apple.mail DisableInlineAttachmentViewing -bool false
This will force Mail not to disable inline attachment viewing. Obviously, to reverse this, simple replace 'false' at the end with 'true'.
Thanks to Louise101 from July 2011 for posting this. -
Problem in Displaying image in HTML format for BI Publisher (OTM)
Hello,
We are using OTM 6.2 and we are developing the IB reports to the customer.
I am getting dificulty while displaying the image in HTML format. I used image in JPEG format. When i am running the report, It displayed only in PDF format, but not in HTML and Excel format.
Please do the needful help in this regards.
Thanks & Regards,
Siva DonthiHi Kavipriya,
i have gone thru all your threads on a similar sort of issue which i am facing now, However i m bit struck as i m newbie.
Issue:i am insering a static picture from the c drive into the header section of the rtf template and when previewing the rtf template on the BI publisher the jpg image disappears. i have tried adding the url into the format picture -->alt tab.Still no signs of improvement.
However if just placing the jpg image on header section without using the wrap text it gets displayed.But if i use wrap text on the image ,it disappears.
could you guide me please in fixing this issue .
Appreciate your timely response and your co-operation
Thanks
Joe -
How to remove cached images in html whe going from one page to another page
can anybody help how to remove cached images in html pages.i tried with response.setHeader("no-cache") but it is not working
thanks,
can u tell me how to make the browser not to cache images.since iam moving from one page which has images, into another page which having few more images both gets overlaped so how to remove images of previous page.
thanks in advance -
MIME Multipart/related to embed images in html files - Servlet
Hello,
My goal is to embed images in html/xhtml files to decrease latency when using slow networks. Think about mobile phones, if I have 10 images in one page, I will have 11 requests/responses to get the whole page.
The solution would be to embed all images using Content-type multipart/related, so I have one request to the whole pack.
How to do that in java? I mean, I need to set the content-type and build all parts encoding the images to base64.
I tried JavaMail API, there I can build messages like this and instead of send an e-mail, I can write:
myMimeMultipart.writeTo(response.getOutputStream());
The problem is: I am getting everything as text in my browser, including the MIME headers of each part. Another think is that the first header (the main one) doesn't appear too.
Any thoughts/other ideas?
Thanks in advance,
Andr� CarlucciIf memory serves me right, I believe in the Servlet spec you have access to the Response object. You "should" be able to set any headers you need there. In addition, you can get the output streams just as you described.
I did a similar thing, although slightly modified, to output dynamically-generated XLS (Excel Spreadsheet) files using a reporting engine called JasperReports. It wasn't a multipart response, however, so you may need to figure out how to handle that part of it, but in my case I set the mime-type header, then grabbed the output and started writing my XLS file too it. Once done, you close the streams and return the response. Worked perfect. -
Load remote images in html mail setting does not get saved. I have to turn it off every time I log in. Is this a bug?
Plug your phone into the wall charger for at least 30 minutes...make sure you have a sim card in the phone...then:
Leave the USB cable connected to your computer, but NOT your phone, iTunes running, press & hold the home button while connecting the USB cable to your dock connector, continue holding the home button until you see “Connect to iTunes” on the screen. You may now release the home button. iTunes should now display that it has detected your phone in recovery mode, if not quit and reopen iTunes. If you still don’t see the recovery message repeat these steps again. iTunes will give you the option to restore from a backup or set up as new.
Make sure you have no anti-virus software running or any firewalls...turn all of that stuff off. -
How to include image or html dynamically in a JSP?
I need to show the uploaded content in a jsp. It could be either a image or html file. How can i include these images or html files dynamically without affecting screen design.
What the heck is 'screen design'? You mean the page layout?
You could show in a popup div; JQuery will be your best bet for a prebuilt function to do that. But you'd need to put the uploaded file in a place where the browser can fetch it through an URL, or you need to create a servlet that can load and return the data to the browser. -
i was wondering if i could embed images into html and end up with a single file
olafgarten212 wrote:
i was wondering if i could embed images into html and end up with a single file
No you can't. An image file is an image file while HTML file is simply a text file that can be read and edited with any text editor. Image files can't be edited in the normal way without the use of special programs like Photoshop, fireworks, and other free ones that can be downloaded.
However, as your question is vague as pointed out by Nancy O, I would hazard to guess that you want to save a webpage that can be viewed off-line. If this is the case then I suggest use Internet Explorer to save the page as .mht file. This will allow you to have a complete page including images and style sheets all in one file.
The file is saved as: File >> save as >> "myfile.mht"
The saved file is a single web archive, single file that can also be edited in Microsoft Word.
Good luck. -
How to use add image in HTML tag
Hello frndz
i m working on text chat application in adobe air.using <mx:html/> tag for dispalying text and images(smiley).but the font size fo flex is diffrent and html diffrent.i mean i m using 10 font size but it looks too large on <mx:html/> component.is there any way to cast them in same size.
The second and major problem is that it can not add images to html tag.when i m giving images like:-private var txt:String="<img src='src\smily\tongue.gif'/>" .
it shows nothing but when i give images through http path it shows images on html componenet.
can any body explain me the problem.
Thanks And regards
Vineet Oshothanks Alot René Bühling for your quick reply.but the link u mentioned ith reply is not working for me.
ok can u tell me how can i manage my flex font size 10 to <mx:html tag 's font size 10.
i think there is large difference between flex font and html font.so please guide me for that.
Thanks Alot
Vineet osho -
How to Prevent Downloading Images in HTML Mail?
Is there an option to prevent the downloading of images in HTML emails? If not, is there a way to view all emails as text-only?
No to both questions.
There is a message preview function with the following options:
None
1 Line
2 Lines
3 Lines
4 Lines
5 Lines
The preview function does not open the message. If you select a message to open/view the message, any embedded images or objects that must be rendered from a remote server to be viewed included with HTML formatting will be rendered. -
Saving images from html email.
Hi.
Please help.
I can't save images from html email. I can save attachments, but how save images with in html?
I can't find it.I can send if I use:
// Create your new message part
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = "<H1>Hello</H1>" +
"<img src=\"cid:memememe\">";
messageBodyPart.setContent(htmlText, "text/html");
// Create a related multi-part to combine the parts
MimeMultipart multipart = new MimeMultipart("related");
multipart.addBodyPart(messageBodyPart);
// Create part for the image
messageBodyPart = new MimeBodyPart();
// Fetch the image and associate to part
DataSource fds = new FileDataSource(file);
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setHeader("Content-ID","<memememe>");
// Add part to multi-part
multipart.addBodyPart(messageBodyPart);
but if I try to read message (html and image inside it) sended from Outlook? i can't find images.
messageBodyPart.getHeader("Content-ID");
returned null.
Maybe you are looking for
-
Need to do a clean install, important questions
Hi all, For several months my two-year-old MacBook has been having a serious typing issue that I have not been able to resolve. When I am typing, quite frequently, the typing will move to the middle of the text box (or Word document) and start writin
-
Help w/ re-installing OS after HD reformatt/restore
I have a 12" G4 powerbook. I had bought it from a friend and was trying to reformat and restore the HD the other night. I walked away from it to let it do it's thing and came back to the gray screen (like when you boot it up after a restart) where it
-
BAPI_DOCUMENT_CREATE2 error
Hi!! I'm trying to create a document through BAPI_DOCUMENT_CREAT2, we fill everything and run, not an error but the document is not created, follows the fields that I filled DocumentType - DBE DocumentNumber - 22224 DOCUMENTVERSION - 00 DOCUMENTPART
-
IChat crashes after Leopard Upgrade
I upgraded to Leopard (Upgrade. Not Archive-Install or Fresh) from Tiger, and iChat crashes when I try to open the video Preferences. I am not logged on to any chat service. Here are the steps to reproduce the crash: 1. Open iChat (Auto-Login is disa
-
Trouble with query and parse in nstrument i/o assistant
I am setting up instrument i/o assistant to communicate with a simple serial instrument. Labview is communicating effectively with my instrument (instrument responds to on/off commands sent by labview) but am not reading data from the instrument. He