Setting max-height with contain for bg image

Hi , I currently have a simple image that I want to sit in the top right corner, however I would like it to scale so the whole image fills the right hand of the viewport (only if they make the viewport smaller than the original image though). The contain function does this job however it also scales the image upwards should the user go full browser which looks horrible. So my question is can I use ( background-size: contain;) but add a max-height line to it also. I have tried every combination possible but nothing. Im either doing something wrong or it cant be done.
Site: http://www.stuartskelton.co.uk
my css is:
body  {
margin: 5px;
background-attachment: fixed;
background-image: url(../images/neilquote.gif);
background-repeat: no-repeat;
background-position: right top;
background-size: contain;
Thanks for looking.

You can't add a max-height to the existing rule, but you could use a media query to change the value of background-size like this:
body  {
margin: 5px;
background-attachment: fixed;
background-image: url(../images/neilquote.gif);
background-repeat: no-repeat;
background-position: right top;
background-size: contain;
@media screen and (min-height: 462px) {
    body {
        background-size: 55px 461px;

Similar Messages

  • How to set background as white colour for Bitmap images in sapscripts?

    Hi,
    Can anyone let me know that How to set background as white colour for Bitmap images in sapscripts?Actually,I am getting grey as background as defualt for my Bitmap images.
    Sorry,in my previous question,I posted viceversa.I am mistaken.
    Thanks,
    Balaji

    Hi,
    The problem can be solved by changing the way you save the original image.
    Take a look at this thread which explains;
    Problem with logo
    Regards,
    Nick

  • How to set a keyframe with setValueAtTime for only one axis?

    Hi,
    I´d like to set a keyframe for the layer´s scale, anchor point values but separately. Let´s say I want to add the following keyframes to a layer:
    time: 0, value: 100, axis: X
    time: 0.3, value: 10, axis: Y
    time: 1, value: 110, axis: X
    If I use setValueAtTime(time ,[x, y]) it always places a keyframe for both axis.
    How can I set a keyframe with setValueAtTime for only one axis?
    Regards,
    Thomas

    Dan, thanks for your fast reply. But the problem is a bit difficult to describe for a german like me
    I´m try to convert given keyframes from another application. Let me visually show how it handles keyframes that are set on different axis at different times:
    X: O---O---O
    Y: ---O--O-O
    You see when the user sets a keyframe and both axis were modified, both have a keyframe (see the last key). But if only one axis is transformed and the other not, there is only one keyframe. The problem that I try to solve is that AE is only able to set a keyframe for both axis at a given time. So if I set the 3 keyframes of the X axis first, the AE script will set keys on the Y axis simultaneously. That´s bad because it adds keyframe to the other axis where there is no value "cache". So if I would set all keyframes it would look like this:
    X: O--•O-•-O
    Y: •--O•-O-O
    The small dots indicate those "forced" in-between keys.
    So is there a "native" scripting way to separate the dimensions (like the position prop) for other props and add independent keyframes?

  • How set autocommit=false with container transactions?

    Hi all!
    A'm using EJB's with transaction attribute=Container.
    This is simple scenario:
    call Session Bean
    begin transaction
    call EntityBean1 {
    database update 1
    call EntityBean2 {
    database update 2
    end transaction
    return from session bean
    The problem is:
    when update2 fails update1 not rolling back.
    A know, that solution of this problem is set AUTOCOMMIT=FALSE in Connection, but how do this with container transactions? Point me exactly to place, where this can be done, if this possible. Or may be no general solution (I.e. Each case demands it's own approach.)?
    (I can't directly call method of Connection object because of transaction managed by container)
    Tnx a lot.

    Hi there,
    I have the same problem with Orion and NuSphere MySql.
    When I define a container-managed transaction, the autocommit mode is not changed.
    I have a session bean for which I set the transaction attribute to REQUIRED and two entity beans for which the transaction attribute is SUPPORTS in the ejbjar.xml file.
    The session beans calls the two entity beans and makes some modifications on them like for instance removing them from the database.
    When I check whether a transaction can be rolled back, for instance by putting in my code a loop that never ends and then stopping the server, it seems my application is running in autocommit mode. No rollback is done.
    This is very strange.
    The two entity beans are stored using gemini tables which permit rollbacks. So when I start a transaction inside mySql using sql statements, I can do a rollback without problem.
    Any idea of what's going wrong ?
    Dimitri.

  • Can I set up a pro forma for multiple images

    Hi all
    Well I am a newbie to Keynote and I am really enjoying using it.
    I am trying to set up a pro forma for class photos at a school, the photos have been handed to me by the teachers but are all slightly different sizes.
    My question is can I set up some sort of master document where I can place the photos (head shots) of the students with their names under them ready for a keynote display and have the photos all the same size without editing them separately.
    I need to be able to remove photos occasionally too (ie if they are absent etc) so would need it to be a 'changeable' master rather than a screen shot.  The amount of students in each class varies from 15 to 29 so I would need to accommodate the 29 with names under them and a heading somewhere on the page.
    Is it doable?  Do I do it straight into the keynote or onto a pages document first?
    Thanks in advance for any help advice you can give.
    Regards
    Alitheste

    The Mac OS X Mail application has a "Junk" function that works locally, on the Mac, and just puts emails from previously designated "junk" addresses into a separete folder, so you don't have to wade thru all that spam in your Inbox. It's a very elegant and simple, local solution, that I dearly miss on iOS.
    I did submit a request for it at Apple Feedback page.
    http://www.apple.com/feedback/

  • Setting isolation level with JDriver for Oracle/XA

    edocs (http://e-docs.bea.com/wls/docs70/oracle/trxjdbcx.html#1080746) states that,
    if using jDriver for Oracle/XA you can not set the transaction isolation level
    for a transaction and that 'Transactions use the transaction isolation level set
    on the connection or the default transaction isolation level for the database'.
    Does this mean that you shouldn't try to set it programatically (fair enough)
    or that you can't set it in the weblogic deployment descriptor either? Also anybody
    got any idea what the default is likely to be if you are using an Oracle 9iR2
    database? Is this determined by some database setting?

    IJ wrote:
    edocs (http://e-docs.bea.com/wls/docs70/oracle/trxjdbcx.html#1080746) states that,
    if using jDriver for Oracle/XA you can not set the transaction isolation level
    for a transaction and that 'Transactions use the transaction isolation level set
    on the connection or the default transaction isolation level for the database'.
    Does this mean that you shouldn't try to set it programatically (fair enough)
    or that you can't set it in the weblogic deployment descriptor either? Also anybody
    got any idea what the default is likely to be if you are using an Oracle 9iR2
    database? Is this determined by some database setting?The system should honor the setting defined in the deployment descriptor,
    however, for oracle it may not be helpful to change it. Oracle provides two
    isolation levels. The default is always READ_COMMITTED. The other
    setting is SERIALIZABLE, but this hurts performance, and is also problematic
    in the way oracle implements it. For instance, even if you set SERIALIZABLE,
    oracle will not lock read data. It will allow other transactions to read and/or
    alter data trhat another ongoing SERIALIZABLE transaction has read. The
    only way to really lock read data in oracle is to issue oracle-specific SQL in
    your select: "SELECT ..... FOR UPDATE".
    All in all, you should collect a strong case for why you can't proceed with
    READ_COMMITTED first. Then you should research oracle's recommendations
    (and their problem record) with SERIALIZABLE.
    Joe Weinstein at BEA

  • I need help with searching for an image inside another image

    I need to write a program that checks for a specific image (a jpg) inside another, larger, image (a jpg). If so, it returns a value of true. Can anyone help me?
    Winner takes all. First person to solve this gets 10 dukes.
    Please help.

    Hi,
    I would use a full screen image Sequence made with png for transparency and put your article behind. no auto play, stop at first and last image. and information for swipe to display article.

  • Will 3d studio MAX work with FCP for special effects?

    If these applications work together, I was wondering what format and resolution to render, for animated files to be used in FCP.
    thanks
    CH
    G5 Dual 2.3GHz   Mac OS X (10.4.4)  

    FCP is an editing program. It will deal with a multitude of formats. If you want to know if 3ds has a 'send to FCP' function a la shake, I doubt it. Render a targa image sequence out of 3ds, import it in through a quicktime conversion (targa seq. to .mov), then FCP will deal with it nicely.

  • Using the Mac with windows for document imaging business is it practical?

    I have incorporated my business in my state and the premise is to perform document imaging services. The problem though is alot of recommendations from windows people telling me its not practical to enter this arena using a windows xp on a mac and it would be more practical just getting a pc since the industry and all software for the business is done for windows. I am wondering if I do this using windows on my mac in a commercial atmosphere how much of a problem should Iexpect and should I just go ahead and use a pc laptop for the business. I was also going to use a company that has apple servers for my online backup of files.

    "how much of a problem should Iexpect"
    None. Why would you? Running Windows on a Mac is just like runnning it on any other PC, because Macs...are PCs.

  • Set exported resolution for each image within InDesign

    I'm generating a document in InDesign destined only for the screen (as a PDF) and I'm wondering whether in CS6 the user can set the exported resolution separately for each image. i.e click on a image and set the resolution for that image. Reason: to allow end-viewers to zoom in on certain images and retain quality.
    And while I'm on the subject of changing resolution, a few years ago someone wrote a script for me (in response to a post), that when you clicked on an image within InDesign, resampled the original to 300 dpi, saved it, and made the necessary adjustments in InDesign so the image stayed the same size.
    Can CS6 do that? Or do I need to dig up the old script?

    > ... destined only for the screen (as a PDF) ...
    The developers of PDF will thank you for that statement!

  • How to set the size for Popup with contains a Region

    Hi,
    i use ADF 11g (JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407) with ADF Faces as Frontend.
    I have a Region (with many content) in a popup. When I call the popup the size of the popup is very small.
    If i set explicit the width and height in px it works, but if I set the width and height in % it doesn't works.
            <af:popup id="p1">
              <af:dialog id="pw2" type="ok"
                         partialTriggers="t1:showBook">
                <af:region value="#{bindings.bookkeydata1.regionModel}" id="r1"
                           inlineStyle="width:850.0px; height:600px;"/>
              </af:dialog>
            </af:popup> It is possible to get the max. height and witdth from the browser-window in a Bean and set it dynamicly to the region?
    To set the size in px is not the best solution I think.
    kind regards
    Martin

    Hi,
    Try setting percentages using af:panelStretchLayout inside a popup.
    Thanks.

  • Why can't firefox deal with percent max-height of percent max-height?

    I think this is possibly a bug.
    Firefox is not able to use percent max-height of a percent max-height. Chromium does. But it is difficult to explain. Please have a look at this fiddle, with firefox and chromium, you will see the different behaviour by resizing the browser window: http://jsfiddle.net/qx75g/
    I need this for my website but cannot use it, because it does not work with firefox :(
    ( archlinux with firefox 28.0 )

    Okay, so the page on MDN says
    <blockquote>The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as none.</blockquote>
    https://developer.mozilla.org/en-US/docs/Web/CSS/max-height
    That seems to be copied more or less verbatim from CSS2 Level 1: http://www.w3.org/TR/CSS2/visudet.html#min-max-heights
    Which makes me think that it isn't like to change in the near future...
    Any reason not to set height:50% for .inner? How does leaving that unspecified benefit the layout?

  • Is there a way to use a single bitmapdata for multiple images with GPU mode?

    With GPU mode is there a way to bring in a single 1024 X 1024 png containing all my sprites and then slice it up into multiple display objects all refering to the original BitmapData?
    I have an app that runs in GPU mode - but I want to optimize the image management.
    I am making three sets of images in the orders of 2048, 1024 and 512 px.
    The app is a book app and each page has around 4 to 5 bitmaps. I would like to bring in one single image and slice it up - but just refer to the original bitMapData in the memory.
    Is there a way to do this - e.g. using a masking technique?
    I think it is possible using textures in direct mode - but that is not an ideal solution for me - as the app is already in the appstore - and I would have to entirely refactor it for stage3D. Also I use very large bitmaps which have some masking animations applied to them dynamically: http://youtu.be/Nm0T1jLCTz8?t=42s
    Currently, I use jpgs and a jpeg mask file for each image which I composite to get the alpha - then I scale them.
    PNGs may be better for GPU - (no compositing) but they make for a huge app file.
    Now I am converting it to use diffent sized assets depending on the device, then scaling them if need, and then compositing them for apha.  What I was hoping was to find a technique that could reduce the number of bitmapdata objects used and reduce the operations in general. 
    Any thoughts on optimizing would be appreciated.  I can add my code here if it helps.

    Tell Apple:
    http://www.apple.com/feedback/iphone.html
    We're all users here, just like you.

  • Setting azure portal icon for new images

    According to the Azure Service Management REST API, one should be able to set the icon to be displayed in the portal using the IconUri and SmallIconUri tags as described here.
    http://msdn.microsoft.com/en-us/library/azure/jj157198.aspx
    I sent this command with these values set to the URLs for publicly available png icon files and created a new image.  The image was created successfully and no errors were returned, however the icons displayed are still the default windows icons.
    Is this feature disabled somehow or is there some other specification that needs to be set or addressed?
    I could continue to try endless possibilities (like different sized icons or URL locations) but it seems like this should have worked according to the API specification since no other restrictions were stated.
    Could someone please tell me how to get this to work?
    Bruce

    Hi
    Sorry for mis-understand your question:
    I think this IconURI feature disabled.
    Because in latest Azure Management Class libraries, this class libraries is based on latest Azure REST API.
    You can't find IconUri property.
    MSDN article always update slowly.
    namespace Microsoft.WindowsAzure.Management.Compute.Models
    // Summary:
    // The List OS Images operation response.
    public class VirtualMachineOSImageListResponse : OperationResponse, IEnumerable<VirtualMachineOSImageListResponse.VirtualMachineOSImage>, IEnumerable
    // Summary:
    // Initializes a new instance of the VirtualMachineOSImageListResponse class.
    public VirtualMachineOSImageListResponse();
    // Summary:
    // Optional. The virtual machine images associated with your subscription.
    public IList<VirtualMachineOSImageListResponse.VirtualMachineOSImage> Images { get; set; }
    // Summary:
    // Gets the sequence of Images.
    public IEnumerator<VirtualMachineOSImageListResponse.VirtualMachineOSImage> GetEnumerator();
    // Summary:
    // A virtual machine image associated with your subscription.
    public class VirtualMachineOSImage
    // Summary:
    // Initializes a new instance of the VirtualMachineOSImage class.
    public VirtualMachineOSImage();
    // Summary:
    // Optional. The affinity in which the media is located. The AffinityGroup value
    // is derived from storage account that contains the blob in which the media
    // is located. If the storage account does not belong to an affinity group the
    // value is NULL and the element is not displayed in the response. This value
    // is NULL for platform images.
    public string AffinityGroup { get; set; }
    // Summary:
    // Optional. The repository classification of the image. All user images have
    // the category User.
    public string Category { get; set; }
    // Summary:
    // Optional. Specifies the description of the image.
    public string Description { get; set; }
    // Summary:
    // Optional. Specifies the End User License Agreement that is associated with
    // the image. The value for this element is a string, but it is recommended
    // that the value be a URL that points to a EULA.
    public string Eula { get; set; }
    // Summary:
    // Optional. Specifies a value that can be used to group images.
    public string ImageFamily { get; set; }
    // Summary:
    // Optional. Indicates whether the image contains software or associated services
    // that will incur charges above the core price for the virtual machine. For
    // additional details, see the PricingDetailLink element.
    public bool? IsPremium { get; set; }
    // Summary:
    // Optional. An identifier for the image.
    public string Label { get; set; }
    // Summary:
    // Optional. Specifies the language of the image. The Language element is only
    // available using version 2013-03-01 or higher.
    public string Language { get; set; }
    // Summary:
    // Optional. The geo-location in which this media is located. The Location value
    // is derived from storage account that contains the blob in which the media
    // is located. If the storage account belongs to an affinity group the value
    // is NULL. If the version is set to 2012-08-01 or later, the locations are
    // returned for platform images; otherwise, this value is NULL for platform
    // images.
    public string Location { get; set; }
    // Summary:
    // Optional. The size, in GB, of the image.
    public double LogicalSizeInGB { get; set; }
    // Summary:
    // Optional. The location of the blob in Azure storage. The blob location belongs
    // to a storage account in the subscription specified by the SubscriptionId
    // value in the operation call. Example: http://example.blob.core.windows.net/disks/myimage.vhd
    public Uri MediaLinkUri { get; set; }
    // Summary:
    // Optional. The name of the operating system image. This is the name that is
    // used when creating one or more virtual machines using the image.
    public string Name { get; set; }
    // Summary:
    // Optional. The operating system type of the OS image. Possible values are:
    // Linux, Windows.
    public string OperatingSystemType { get; set; }
    // Summary:
    // Optional. Specifies a URL for an image with IsPremium set to true, which
    // contains the pricing details for a virtual machine that is created from the
    // image. The PricingDetailLink element is only available using version 2012-12-01
    // or higher.
    public Uri PricingDetailUri { get; set; }
    // Summary:
    // Optional. Specifies the URI that points to a document that contains the privacy
    // policy related to the image.
    public Uri PrivacyUri { get; set; }
    // Summary:
    // Optional. Specifies the date when the image was added to the image repository.
    public DateTime PublishedDate { get; set; }
    // Summary:
    // Optional. The name of the publisher of this OS Image in Azure.
    public string PublisherName { get; set; }
    // Summary:
    // Optional. Specifies the size to use for the virtual machine that is created
    // from the OS image.
    public string RecommendedVMSize { get; set; }
    // Summary:
    // Optional. Specifies the URI to the small icon that is displayed when the
    // image is presented in the Azure Management Portal. The SmallIconUri element
    // is only available using version 2013-03-01 or higher.
    public Uri SmallIconUri { get; set; }
    You can get this class libraries by nuget manage cmd:
    Install-Package Microsoft.WindowsAzure.Management.Libraries -Pre
    My Blog
    Please use Make as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

  • Setting width/height of a control with CSS

    Hi,
    I am styling a button a button in CSS and set a background-image for the button in my stylesheet.
    The problem is, that the button should scale to the width/height of the image.
    I added:
    -fx-width: 32px;
    -fx-height: 32px;
    but it has no effect.
    I also tried it with
    -fx-min-width: 32px;
    -fx-min-height: 32px;
    If I use setMinWidth(32); in Java, it works.
    But I rather want to set it in my stylesheets, because the image can change, if we use another skin.

    CSS documentation (http://docs.oracle.com/javafx/2.0/api/javafx/scene/doc-files/cssref.html) states:
    "JavaFX CSS does not support CSS layout properties such as float, position, overflow, and width. However, the CSS padding and margins properties are supported on some JavaFX scene graph objects. All other aspects of layout are handled programmatically in JavaFX code."
    I thought you might be able to do something using the -fx-shape property, but the shape does not affect the size of the button - so that didn't work.
    I had more luck with the -fx-graphic property - you could try to enhance the stylesheet below to get what you want.
    .root   { -fx-background-color: azure; -fx-padding: 20; }
    #smurf-button { -fx-graphic: url("http://bluebuddies.com/smurf_fun/smurf_race/jpg/Smurf_Race_100x100.jpg"); -fx-background-color: transparent; }
    #smurf-button:hover { -fx-effect: dropshadow( three-pass-box , rgba(184,134,11,0.6) , 20, 0.0 , 0 , 0 ); }
    #smurf-button:armed { -fx-effect: innershadow( three-pass-box , rgba(0,200,0,0.6) , 30, 0.0 , 0 , 0 ); }
    public class ButtonStyle extends Application {
      public static void main(String[] args) throws Exception { launch(args); }
      public void start(final Stage stage) throws Exception {
        final Button button = new Button();
        button.setId("smurf-button");
        final Scene scene = new Scene(StackPaneBuilder.create().children(button).build());
        scene.getStylesheets().add(this.getClass().getResource("style.css").toExternalForm());
        stage.setScene(scene);
        stage.show();
    }

Maybe you are looking for

  • How to make table control rows dynamic/unlimited using TC with Wizard

    Hi Friends , I have designed a table control layout using table control with wizard. Now the problem is when we design a TC layout ,then we have to design it on the page . The page has upper & lower limits. so the maximum size & maximum rows in layou

  • How to do paging in a jsp and how to load data to specific pages

    I want to show 10 rows of data in a one page and remain in other pages. How to do it and let me know how to use tags inside display:table.Because I'm using a display:table tag to show data. Also I have already add requestURI attribute and map it insi

  • MP3 ID3 tags

    I'm looking for some free shareware software to do MP3 ID3 tags to use along with itunes. Can anyone suggest a good one to use? Thanks.

  • Can't use voice in Yahoo chatrooms. w/ x-fi n vista rc1 wiht USB mic

    I am now using my USB, but still no sound in YM, anyone know why? I know think this is affected by creative soundcard, but why?

  • Chord changes in Apple Loops

    I'm trying to use an Apple Loop in Logic Pro to play a bass line in the song I'm writing. In the Loops tab in the Media Window the loop plays in E, which is fine when the chord progression is in E, but when I move to A or C or whatever's next, how do