Search Results

Search found 6478 results on 260 pages for 'hippy head'.

Page 57/260 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Which book should I choose?

    - by sebastianlarsson
    Hi guys, I'm looking for a good read on object oriented design. The two books I'm currently looking Head First Design Patterns and Head First Object object-oriented analysis & design. They seem very similar when looking at the contents and browsing through available sample text. Which one would be the best choice? About myself: I have a bachelor in computer science and I am currently studying Msc. Software Quality Engineering (read Software Engineering with focus on Quality). I am already confident in object-oriented design and have a lot of programming courses in my backpack. I have done games in c++, courses in advanced java programming (I am SCJP certified), but my preferred language is C#. I have also worked with Java for the last 7 months while studying. I am currently also studying for certificates in C# (apart from my usual studies). So I believe I have the prerequisites of actually understanding the contents of both books. Reason: I just want to be better and keep evolving as a programmer. I think it is fun. I believe Bert Bates and Kathy Sierra are involved in both these books and I have previously read their SCJP preparation book in java. I really do enjoy their style of writing. Other books which I am considering are: Clean Code: A Handbook Of Agile Software Craftsmanship Thx in advance Sebastian

    Read the article

  • No right-click event Firefox 3.6

    - by cdmckay
    I'm in the process of porting an app to JavaScript/CSS and it uses right-click. For some reason Firefox 3.6 for Windows isn't issuing a right-click event, but Chrome and IE do. Here's some test code. If you right-click #test then you get nothing in Firefox but you get an alert under Chrome and IE. <html> <head> <title>Hi</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $("#test").get(0).oncontextmenu = function() { return false; }; $("#test").mousedown(function() { alert("hi"); }); }); </script> </head> <body> <div id="test" style="background: red;">Hi</div> </body> </html> Why isn't the right-click event being generated in Firefox?

    Read the article

  • IE8 CSS Table Effect

    - by Ian
    I've been trying to make this cross browser (specifically IE), but I do not want to use tables. I will not be able to specify the container width with CSS because its contents (the image) will dynamically change with Javascript, so I need the container to 'auto-size' horizontally. The desired effect would be a centered image with two sets of text (one of the left and one of the left) directly underneath the image, aligned to it's inner edges. Example (Doesn't work on IE): http://pastehtml.com/view/19pbyw9.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> #container { display:table; } </style> </head> <body> <center> <div id="container"> <img src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" alt="" /><br /> <span style="float: left;">test</span> <span style="float: right; text-align: right;">test2</span> </div> </center> </body> </html>

    Read the article

  • Run an ActiveX through Web

    - by balexandre
    We have a webpage that works fine on the local computer as it uses a COM Object that is only available in the local computer. the program generates HTML code: <html> <head> <script type="text/javascript"> <!-- function ResizeControl(){Y = document.body.clientHeight;if (Y < 1) {Y = 1}X = document.body.clientWidth;if (X < 1) {X = 1}ActiveX.width = X;ActiveX.height = Y} --> </script> <style type="text/css">html, body { overflow:hidden; } </style> </head> <body OnResize="ResizeControl()" OnLoad="ResizeControl()" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0"> <object id="ActiveX" classid="CLSID:8EC68701-329D-4567-BCB5-9EE4BA43D358" width="14" height="14"> <PARAM NAME="tabName" VALUE="Complaints"> </object> </body> </html> and shows fine My question is, How can we port this into a web environment? As the Delphi developer has no idea and I'm not a Delphi fellow. I want to be able to use this "webpage" on a web address http://INTRANET/mysite/thispage.html Any idea, any though, any door to open is greatly appreciate :)

    Read the article

  • Python template engine

    - by jturo
    Hello there, Could it be possible if somebody could help me get started in writing a python template engine? I'm new to python and as I learn the language I've managed to write a little MVC framework running in its own light-weight-WSGI-like server. I've managed to write a script that finds and replaces keys for values: (Obviously this is not how my script is structured or implemented. this is just an example) from string import Template html = '<html>\n' html += ' <head>\n' html += ' <title>This is so Cool : In Controller HTML</title>\n' html += ' </head>\n' html += ' <body>\n' html += ' Home | <a href="/hi">Hi ${name}</a>\n' html += ' </body>\n' html += '<html>' Template(html).safe_substitute(dict(name = 'Arturo')) My next goal is to implement custom statements, modifiers, functions, etc (like 'for' loop) but i don't really know if i should use another module that i don't know about. I thought of regular expressions but i kind feel like that wouldn't be an efficient way of doing it Any help is appreciated, and i'm sure this will be of use to other people too. Thank you

    Read the article

  • Safari openwindow function behavior on iPad versus iPhone

    - by CodeLizard
    An identical javascript:openwindow call with a link to Google maps opens in Safari on the iPad but in the Google Maps App on the iPhone. Why the difference? <html> <head> </head> <body> <a title="View an area map for this property" href="javascript:openwindow ('http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=1+Infinite+Loop, +Cupertino,+CA%E2%80%8E&sll=37.329389, -122.029696&sspn=0.015714,0.033023&ie=UTF8&hq=&hnear=1+Infinite+Loop, +Cupertino,+Santa+Clara, +California+95014&ll=37.331539, -122.030704&spn=0.007857,0.016512&z=17&ssa=1', 760, 500,'yes', 'yes')"> <font face="arial,helvetica" color="#000000" size="-1">Map It</font> </a> </body> <script> function openwindow(url,width,height,resizable,scrollbars,posx,posy) { if(posx==null)posx=20; if(posy==null)posy=20; now=new Date(); var x_offset=0; var y_offset=0; try { if(window.screen.left != undefined && window.screen.top != undefined) { x_offset=window.screen.left; y_offset=window.screen.top; } }catch(e){} var window_x=posx+x_offset; var window_y=posy+y_offset; new_window=window.open(url,now.getTime(),'width='+width+',height='+height+', resizable='+resizable+',scrollbars='+scrollbars+',top='+window_y+', left='+window_x+',screenX='+window_x+',screenY='+window_y); if(!new_window.opener) new_window.opener=self; try { new_window.focus(); }catch(e){} } </script> </html>

    Read the article

  • jQuery: list appended not displaying bullets

    - by Shizhidi
    I have the following html: <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <span>not so important</span> <span title="some specific text"><img src="/img/some.gif" /></span> <span title="more specific text">important 1</span> <span title="more specific text">important 2</span> <span title="more specific text">important 3</span> <span title="more specific text"><img src="/img/some.gif" /></span> <ul> <li>example 1</li> <li>example 2</li> <li>example 3</li> <ul> <script> var ul = $('body').append($('<ul>')); $("span[title*='specific text']") .contents() .filter(function(){ return $(this).nodeType != 1; }) .each(function(){ ul.append($('<li>' + $(this).text() + '</li>')); }) </script> </body> </html> I want to retrieve the text within a 'span' whose title attribute contains "specific text", in this case "important 1", "important 2" and "important 3". Then I want to list them below just like the example. However the bullets do not appear, why is that? Any hints would be appreciated!

    Read the article

  • JQuery Autocomplete Where the Results are Links

    - by Spencer
    I am trying to create a JQuery Autocomplete box where the words being suggested for autcomplete are links (similar to what happens on Facebook or Quora). Basically, I want the autocomplete results to drop down and I want people to be able to click on them and be navigated to a different page. Here is the code I am currently using <!DOCTYPE html> <html> <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script> $(document).ready(function() { $("input#autocomplete").autocomplete({ source: ["Spencer Kline", "Test Test Test Test Test Test Test Test Test", "php", "coldfusion", "javascript", "asp", "ruby"] }); }); </script> </head> <body style="font-size:62.5%;"> <input id="autocomplete" /> </body> </html>

    Read the article

  • Right way to center a <div> in xhtml?

    - by Meredith
    Im working with a XHTML 1.0 Transitional doctype html file, and I want to have a main div with 800px width and make it appears centered (not the div content, but the div itself). I've used this on the past: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style> <!-- html, body { margin:0; padding:0; } #main-container { background:black; width:800px; } --> </style> </head> <body> <center> <div id="main-container"> Content </div> </center> </body> </html> But I am not sure if this is cross-browser compatible, or if its valid xhtml.

    Read the article

  • jQueryUI Slider handle not moving

    - by DavidYell
    I'm trying to implement a jQuery slider with increments. I've gone from, the actual project page, to a test page of the project with just the slider, to just the slider. In all cases I've been unable to get the handle to move. It also seems to have a width of 1px or similar. My code is as follows, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>jQuery slider</title> <link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.custom.css" type="text/css" media="screen" charset="utf-8" /> <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script> <script type="text/javascript"> $(function() { $("#slider").slider(); }); </script> </head> <body> <div id="slider"></div> </body> </html> I'm sure there is something very simple at fault here, but I really cannot see it for the life of me. The custom part of my download, was just clicking the 'select all components'.

    Read the article

  • Horizontally and Vertically Center Modal Div IE Issue

    - by aherrick
    I'm trying to horizontally and vertically center a modal window inside a div. I want it to be cross browser compatible. You can see from the picture below that when I resize IE8 then click, "show modal" button it displays not exactly horizontally centered. This does not seem to be an issue with Chrome. Any thoughts? How would you guys accomplish this? <html> <head> <title>test</title> <style type="text/css"> * { margin: 0px; padding: 0px; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { $('#modal').click(function() { // overlay $('<div id="overlay" />').css({ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', backgroundColor: 'black', opacity: 0 }).appendTo('body'); $('<div id="datamodal" />').css({ backgroundColor: '#FFFFFF', border: '10px solid #999', height: '200px', width: '600px', position: 'absolute', top: '50%', left: '50%', marginTop: '-120px', marginLeft: '-320px', color: '#111111', fontWeight: 'bold', padding: '10px', display: 'none' }).append('<input type="text" />').appendTo('#overlay'); $('#overlay').fadeTo(300, 0.7); $('#datamodal').fadeIn(300); }); }); </script> </head> <body> <input id="modal" type="button" value="show modal" /> </body> </html>

    Read the article

  • How to catch HttpRequestValidationException in production

    - by bruno
    Hello all, I have this piece of code to handle the HttpRequestValidationException in my global.asax.cs file. protected void Application_Error(object sender, EventArgs e) { var context = HttpContext.Current; var exception = context.Server.GetLastError(); if (exception is HttpRequestValidationException) { Response.Clear(); Response.StatusCode = 200; Response.Write(@"<html><head></head><body>hello</body></html>"); Response.End(); return; } } If I debug my webapplication, it works perfect. But when i put it on our production-server, the server ignores it and generate the "a potentially dangerous request.form value was detected from the client" - error page. I don't know what happens exactly... If anybody knows what the problem is, or what i do wrong..? Also I don't want to set the validaterequest on false in the web.config. The server uses IIS7.5, And I'm using asp.net 3.5. Thanks, Bruno

    Read the article

  • Facebook Like Box not working

    - by Gabriel Bianconi
    Hello. I'm trying to integrate a Like box in my website. It wasn't working, so I created a sample page (which also doesn't work). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>FB TEST</title> </head> <body> <iframe src="http://www.facebook.com/plugins/likebox.php?profile_id=185550966885&amp;width=292&amp;connections=5&amp;stream=false&amp;header=true" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:292px; height:px"></iframe> </body> </html> I'm also using the sample iframe code (mine didn't work, so I tried this), taken from: http://developers.facebook.com/docs/reference/plugins/like-box How can I fix this? Thanks in advance.

    Read the article

  • Can Internet Explorer bind events to absolute positioned elements ?

    - by mark
    Can Internet Explorer bind events to absolute positioned elements ? I can't bind a "click" to an element that is overlapping another. Have tried loads of different ways, here a few tests that don't work in IE: //version 1: $(".classHolder").click(function(){ alert( $(this).html() ); }); //version 2: $(".classHolder").each(function(){ $(this).click(function(){ alert( $(this).html() ); }); }); //version 3: $("#id3").click(function(){ alert( $(this).html() ); }); //version 4: $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); // in all trials I tested with and without: // $("img").unbind(); // $("div").unbind(); // just to make sure no "ghost" events were bind into the elements but no success. // replace all [ for < , and all ] for [html] [head] [script src="http://code.jquery.com/jquery-latest.js"][/script] [script type="application/javascript"] $(document).ready(function(){ $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); }); [/script] [/head] [body] [div id="id1" style="position:relative;"] [img id="id2" src="http://www.google.co.uk/intl/en_com/images/srpr/logo1w.png" style=";z-index:-1;"/] [div id="id3" class="classHolder" style="position:absolute;border:2px solid red;left:0px;top:0px;width:70px;height:70px;z-index:1002;"]G[/div] [div id="id4" class="classHolder" style="position:absolute;border:2px solid red;left:210px;top:0px;width:25px;height:70px;z-index:1001;"]L[/div] asd asdf asdfg [/div] [/body] [/html]

    Read the article

  • jquery google link

    - by Val
    Has anyone got any idea how this google code works? i got the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My Google AJAX Search API Application</title> <script src="http://www.google.com/jsapi?key=blahblahblah" type="text/javascript"></script> <script language="Javascript" type="text/javascript"> google.load("jquery", "1"); google.load("jqueryui", "1"); </script> </head> <body> <div class="ui-state-highlight"> hello world </div> </body> </html> However the <div></div> should display the error box with hello world. but it doesn't show the red background therefor the ui is not working ... What have i done wrong here?

    Read the article

  • Issue editing class style properties using js - issue is with IE

    - by Nick
    I have a function to edit the style properties of a class Unfortunately IE does not seem to like it but it does not give me an error. Does anyone know what the issue is? Thanks in advance function myRemoveElement(id) { var Node = document.getElementById(id); Node.parentNode.removeChild(Node); } function boolyChangeFoo(width1, width2, width3, width4) { if(typeof style == 'undefined') { var append = true; myStyle = document.createElement('style'); } else { while (myStyle.hasChildNodes()) { myStyle.removeChild(myStyle.firstChild); } } if (document.getElementById('my_custom_styles')) { myRemoveElement('my_custom_styles'); } var head = document.getElementById('myltd_popup_1'); var rules = document.createTextNode('.my_price_comp_inner { width: ' + width1 + '}' + '.merch_coupons_summary { width: ' + width2 + '}' + '.merch_coupons_data { width: ' + width3 + '}' + '.my_coupon_prod_item { width: ' + width4 + '}' ); myStyle.setAttribute('type','text/css'); myStyle.setAttribute('id', 'my_custom_styles'); if(myStyle.styleSheet) { myStyle.styleSheet.cssText = rules.nodeValue; } else { myStyle.appendChild(rules); } //alert(myStyle); if(append === true) head.appendChild(myStyle); }

    Read the article

  • html5 cache -> "network: *" doesn't work

    - by Greg
    Hello all, I am trying a simple test with the html 5 cache. Here is a simple web page : <!DOCTYPE html> <html manifest="test.manifest"> <head> </head> <body> <img src="http://www.somewebsite.com/picture.jpg"/> </body> </html> With the following manifest : CACHE MANIFEST #v0.1 NETWORK: http://www.somewebsite.com/ This work fine, the picture is displayed. My problem is that I won't be able to know from where the picture will come. Here comes the online whitelist wildcard flag, that is supposed to solve my problem. But with the manifest : CACHE MANIFEST #v0.1 NETWORK: * The image is not displayed (tested on safari / safari mobile / firefox). What is not working ? Is there another way to turn the online whitelist wildcard flag on ?

    Read the article

  • cgi.FieldStorage always empty - never returns POSTed form Data

    - by Dan Carlson
    This problem is probably embarrassingly simple. I'm trying to give python a spin. I thought a good way to start doing that would be to create a simple cgi script to process some form data and do some magic. My python script is executed properly by apache using mod_python, and will print out whatever I want it to print out. My only problem is that cgi.FieldStorage() is always empty. I've tried using both POST and GET. Each trial I fill out both form fields. <form action="pythonScript.py" method="POST" name="ARGH"> <input name="TaskName" type="text" /> <input name="TaskNumber" type="text" /> <input type="submit" /> </form> If I change the form to point to a perl script it reports the form data properly. The python page always gives me the same result: number of keys: 0 #!/usr/bin/python import cgi def index(req): pageContent = """<html><head><title>A page from""" pageContent += """Python</title></head><body>""" form = cgi.FieldStorage() keys = form.keys() keys.sort() pageContent += "<br />number of keys: "+str(len(keys)) for key in keys: pageContent += fieldStorage[ key ].value pageContent += """</body></html>""" return pageContent I'm using Python 2.5.2 and Apache/2.2.3. This is what's in my apache conf file (and my script is in /var/www/python): <Directory /var/www/python/> Options FollowSymLinks +ExecCGI Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher </Directory>

    Read the article

  • Checking parameter classes in PHP

    - by Professor Elm
    At the moment, I have the following: <?php if ($custom != ""): ?> <div class="head-row5" id="custom"> <?php print $custom?> </div><?php //head-row5 ?> <?php endif; ?> What is returned is something like.... <div class="block block-block" id="block-block-15"> <div class="title"> <h3></h3> </div> <div class="content"><p style="text-align: center;"><a href="website linkage" id="T2roll"><span class="alt">Name of the linked page</span></a></p> </div> What I'm trying to do is find a way to print this out ONLY if the is true. How would I go about doing this? I believe that I'm going to have to check the elements by class of this $custom parameter. However, I have no idea how to go about doing this.

    Read the article

  • Background not showing behind floating divs

    - by lolalola
    Hi, what's wrong with this code? The background disappears behind the divs when I add float: left to #text and #text2. But when I remove the float: left, everything looks good. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> #first{ width: 200px; background-color: #345752; } #left_b{ background:transparent url('img/left.png'); background-position: left top; background-repeat: repeat-y; min-height: 30px; } #right_b{ background:transparent url('img/right.png'); background-position: right top; background-repeat: repeat-y; } #text{ float: left; width: 50px; height: 30px; } #text2{ float: left; width: 70px; height: 30px; } </style> </head> <body> <div id = "first"> <div id = "left_b"> <div id = "right_b"> <div id = "text">text 1</div> <div id = "text2">text 2</div> </div> </div> </div> </body> </html>

    Read the article

  • Dynamically created iframe not working on Safari

    - by mhammout
    I have a weird problem and I find no answer on google... I dynamically create and fullfil an iframe with jquery on a page. It works fine withFF and IE, but not with Safari. The iframe is created but empty (the message "greetings from the iframe !" is missing). Here is a piece of code to illustrate it : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-fr" lang="fr-fr" > <head> <title>iframe</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var jFrame = $('<iframe id="myiframe" name="myiframe">'); jFrame.css({'height':'40px','width':'200px'}).appendTo($('#container')); $('#myiframe').load(function() { jFrame.contents().find("body").html('greetings from the iframe !'); }); }); </script> </head> <body> <div id="container"></div> </body> </html> I really wonder why the iframe stays empty with Safari. It seems like if "contents()" was not well interpreted... Any idea ?

    Read the article

  • Best way for launching html/jsp to communicate with GWT module

    - by h2g2java
    I asked this at the GWT forum but I'm impatient for the answer and I seem to get rather good responses here. A html or jsp file is used to launch the xxx.nocache.js, which then decides which browser "permutation" to use. <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8"> <title>xxx</title> <script type="text/javascript" language="javascript" src="xxx.nocache.js"></script> </head> In my case, I am using a jsp. When the JSP is executed, it discovers some conditions. I wish to pass these conditions as values to the GWT module being launched. The "elegant" GWT way to pass these values would be to persist them as request/memcache attributes and then have the GWT module perform RPC to retrieve those values. For example, the JSP discovers that the current user is Whoopy. Shouldn't I simply have the JSP generate javascript to store user = "Whoopy" as a top or namedframe level javascript variable and use JSNI within the module to retrieve the value for user? I have not tried it yet, but I would like to know how anyone might have done it without having to use RPC.

    Read the article

  • Completely bizarre Firefox CSS bug

    - by Jason
    I've been doing front end development for a long time, and I have NEVER come across a bug like this before... Save the following HTML to a file and view it in Firefox (mine is 3.6.3): <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> body { font-family: Helvetica, Sans-Serif;} h2 {font-weight: normal;} </style> </head> <body> <h2>Some normal text <strong>some bold text</strong> weird huh?</h2> </body> </html> If you don't want to give it a shot the output is like your cat walked across your keyboard while character map was turned on, except in the strong tags. I feel like this may be a font issue? When I get rid of font-weight: normal it goes back to normal, but I don't want everything to be bolded in my h2... Anyone have any ideas? More importantly, is anyone able to reproduce this?? Thanks.

    Read the article

  • Why do Firefox and Opera ignore max-width inside of display: table-cell?

    - by brad
    The following code displays correctly in Chrome or IE (the image is 200px wide). In Firefox and Opera the max-width style is ignored completely. Why does this happen and is there a good work around? Also, which way is most standards compliant? Note One possible work around for this particular situation is to set max-width to 200px. However, this is a rather contrived example. I'm looking for a strategy for a variable width container. <!doctype html> <html> <head> <style> div { display: table-cell; padding: 15px; width: 200px; } div img { max-width: 100%; } </style> </head> <body> <div> <img src="http://farm4.static.flickr.com/3352/4644534211_b9c887b979.jpg" /> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis ante, facilisis posuere ligula feugiat ut. Fusce hendrerit vehicula congue. at ligula dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. leo metus, aliquam eget convallis eget, molestie at massa. </p> </div> </body> </html> [Update] As stated by mVChr below, the w3.org spec states that max-width does not apply to inline elements. I've tried using div img { max-width: 100%; display: block; }, but it does not seem to correct the issue.

    Read the article

  • How to change attribute on Scala XML Element

    - by Dave
    I have an XML file that I would like to map some attributes of in with a script. For example: <a> <b attr1 = "100" attr2 = "50"> </a> might have attributes scaled by a factor of two: <a> <b attr1 = "200" attr2 = "100"> </a> This page has a suggestion for adding attributes but doesn't detail a way to map a current attribute with a function (this way would make that very hard): http://www.scalaclass.com/book/export/html/1 What I've come up with is to manually create the XML (non-scala) linked-list... something like: // a typical match case for running thru XML elements: case Elem(prefix, e, attributes, scope, children @ _*) => { var newAttribs = attributes for(attr <- newAttribs) attr.key match { case "attr1" => newAttribs = attribs.append(new UnprefixedAttribute("attr1", (attr.value.head.text.toFloat * 2.0f).toString, attr.next)) case "attr2" => newAttribs = attribs.append(new UnprefixedAttribute("attr2", (attr.value.head.text.toFloat * 2.0f).toString, attr.next)) case _ => } Elem(prefix, e, newAttribs, scope, updateSubNode(children) : _*) // set new attribs and process the child elements } Its hideous, wordy, and needlessly re-orders the attributes in the output, which is bad for my current project due to some bad client code. Is there a scala-esque way to do this?

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >