w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
margin-left and margin-right for Setting Center position
Give the .user-menu a width, currently it is a block element so it will fill its container. This causes the user-menu to expand to 100% width across the page, which technically is centered, you just don't notice it. .user-menu { margin-left:auto; margin-right:auto; width: 100px; }

Categories : HTML

Negative value of margin
Try giving it a position of relative. Like so: .box_stanga { margin-top: 5%; padding: 0px 0px 20px 0px; border: 1px solid #333; box-shadow: 0px 0px 5px 2px #999999; border-radius: 0px 10px 10px 10px; background-color:white; width: 100%; } #recent_vizualizate { top: -600px; float: right; /*margin-left: 20%;*/ position:relative; border: 1px solid #333; box-shadow: 0px 0px 5px 2px #999999; border-radius: 0px 10px 10px 0px; width: 20%; height: 100%; /* -- margin-top: -600px; -- Do Not Use */ position: relative; } #wrapper{width:1080px; margin:0 auto;} I haven't tested that out, but let me know if that works for you. It would be best if you use 'px' for your height and width as well as for your margins.

Categories : CSS

CSS negative margin is not working?
Firstly, change id="#image-three to id="image-three" in your HTML. Remove the # on image one and two also. <img src="../images/templateone.jpg" id ="image" class="image" alt=""/> <img src="../images/templatetwo.jpg" id="image-two" class="image" alt="" /> <img src="../images/templatethree.jpg" id="image-three" class="image" alt=""/> Secondly, to get it how you described, just increase that negative margin. #image { margin-left: -920px; width: 287px; } See - jsFiddle

Categories : CSS

Positioning a div within a parent div using auto margin or %
CSS is tricky!! :D This is a borrowed technique to centre vertically and horizontally, but it would involve changing your HTML and CSS. I am not sure how flexible you are with your code: CSS: #outer {width: 100%; border: 3px solid red;} #middle {width: 100%; text-align: center;border: 3px solid green;} #inner {width: 200px; margin-left: auto; margin-right: auto; text-align: left;border: 3px solid blue;} /* Courtesy: http://www.jakpsatweb.cz/css/css-vertical-center-solution.html */ HTML <!--Title and navigation bar--> <div id='outer'> <!--Left navigation container--> <div id='middle'> <p id="inner">efwfwgwegwegweg</p> </div> </div> You can build upon this to achieve whatever you are after! fiddle: http://jsfiddl

Categories : CSS

CSS positioning relative not showing the top margin
In stead of using top, use margin-top and keep the position as relative http://jsfiddle.net/xvdnm/ Check the JS Fiddle Top has a different behaviour "top" is for tweak an element with use of "position" property. margin-top is for measuring the external distance to the element, in relation to the previous one. Also, top behavior can differ depending on the type of position, absolute, relative or fixed. From: CSS: Top vs Margin-top

Categories : CSS

Clearfix with negative absolute positioning
The elements following the absolutely positioned div are getting stack on top of it? I'm not getting the problem: jsfiddle. Note that I had to fix some typos; double check your classes/IDs in the markup and stylesheet are matching. CSS (with fixed typos): #container { max-width: 1600px; border:2px dotted black; } #header { width: 52.5%; height: 146px; border:1px solid red; } #content { position: relative; } #absolutely_positioned{ position: absolute; top:-100px; background:blue; } Of course, this is assuming my comment above didn't isolate the problem being that your problem_div does not have a closing tag in the code you posted. EDIT In response to your comment above, I know your problem now. You will notice the blue box is aligning right underneath the r

Categories : HTML

Android negative margin does not work
Negative margins should work in LinearLayout and RelativeLayout. What you probably need, is to scroll the HorizontalScrollView with scrollBy(int x, int y) or scrollTo(int x, int y) to achieve the "peek and scroll" effect you described. Also keep in mind that using raw pixel units is generally a bad idea as the actual size will depend on the pixel density of the screen. Prefer dp measurements instead.

Categories : Android

Set negative margin on View programmatically
Access the layout params for your parent layout and modify them as you like: ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams)view.getLayoutParams(); params.topMargin = ...; // etc // or params.setMargins(...); After you've modified the layout, call view.requestLayout().

Categories : Android

Negative Margin in Firefox Using Bootstrap
The HTML you posted and CSS looks good to me in Firefox and IE, see http://www.bootply.com/72944 Perhaps you could start by double checking the paths to your CSS files and make sure there isn't some other problem with the HTML on your page? Good luck!

Categories : HTML

WebKit Issue with negative top margin
You will define a div #HomeTopBckgrnd with: height: 1240px; margin-top: -360px; fixed heights will ask for troubles. Why not something like: <header></header> <div id="HomeTopBckgrnd"> Your centent here</div> <footer></footer> or <div id="HomeTopBckgrnd"> <header></header> <div> Your centent here</div> <footer></footer> </div>

Categories : CSS

Issue with negative margin on Firefox and IE
Please use float none for parent div it will make the behaviour common on all browsers and then set margin in negative according to your needs. .row-fluid .span12 { float: none; }

Categories : CSS

Absolute Div Being Clipped with Negative Margin
Have just forked your fiddle to show you a workaround. Basically I wrapped everything in an outerContentContainer. The labels div is now absolutely positioned as a direct child of the outerContentContainer. You can then add overflow:hidden to your contentContainer. Seems like a bit of a hack but overflow:hidden or auto will clip your content but you need it in order to auto expand according to child divs Js fiddle is at http://jsfiddle.net/a3TvU/2/ <div class="outerContentContainer"> <div class="labels">Test 123</div> <div class="contentcontainer"> and the css is .labels { position: absolute; top:-30px; left:-30px; padding: 10px 10px; height: 35px; background: #0FF; color: #d94a3c; font-family: font1; font-size: 2.0em;

Categories : HTML

Responsive margin positioning issue in safari
Try giving a height, sometimes when using position absolute width and height are required for the box element to use other properties like margins and paddings. I also see that this is being applied to an anchor, make the anchor a block to use the box model, display:block

Categories : HTML

How to get my negative top margin to be consistent in desktop Safari?
I found a way to add browser specific classes to my body class here: http://codebyte.dev7studios.com/post/4180628671/add-browser-to-body-class-in-wordpress Simply changed #site-title { margin-top: -30px; } to .safari #site-title { margin-top: 0; } Hope this helps someone!

Categories : CSS

Animation slows down when left margin becomes negative
I don't have an explanation why the negative margin animates slowly, but I found a workaround. Instead of animating the Margin of the Path I animated the X value of a TranslateTransform on the Border object that contains the path. I had to put the TranslateTransform in front of the ScaleTransform so that the translation was applied before the scale. That allows you to use almost the same values in your animation that you used for the Margin. <Storyboard x:Key="MovingAnimation"> <ThicknessAnimationUsingKeyFrames RepeatBehavior="1:0:0" Storyboard.TargetName="_blank" Storyboard.TargetProperty="Margin" > <LinearThicknessKeyFrame KeyTime="0:0:0" Value="-1.5,0,0,0" /> <LinearThicknessKeyFrame KeyTime="0:0:10" Value="1,0,0,0" />

Categories : Wpf

Negative margin element clipped outside of div only in one case?
Some example html/css would help us answer your question, but if the scrollbar is causing the negative margin to be clipped, why not just hide the overflow on the div to prevent the scrollbar from rendering? div { overflow-y:hidden; }

Categories : HTML

Percentage width list grid layout with percentage left margin on
  • and negative percentage left margin on the
  • you are trying to give width in % and each item width is 32% which becomes 32*3 becomes 96% and with marign of 2% on each item it becomes total 102% and ur width is 100% and current list will always take the width according to your container width whether u use margin or not you should divide container width on total list item including with the margin http://jsfiddle.net/6DEv9/2/ use this li { width: 31%; float: left; margin: 0 0 0 2%; list-style: none; }

    Categories : CSS

    RelativeLayout positioning issue with first child LinearLayout using margin
    The RelativeLayout provides some tags for the positioning of Views/ViewGroups relative to another View/ViewGroup. android:layout_below="id" and android:layout_above="id" This will put the View below/above another View with the id. android:layout_alignRightOf="id" and android:layout_alignLeftOf="id" This will put the View to the right/left of another View with the id. All tags have the same usability like this, where I use the android:layout_below="" to set a View/ViewGroup below another: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rl_page" android:layout_width="fill_parent" android:layout_height="fill_parent"> <--! YOUR LAYOUT AT THE TOP OF YOUR PARENT --> <LinearLayout android:id="@+id/ll_f

    Categories : Android

    trouble styling li and span - margin / padding / positioning
    change these #blog .pagination ul { background: #fff; display:inline-block; padding: 15px; margin-top: 60px; } #blog .pagination ul li { display: inline-block; } that should do it

    Categories : HTML

    JQuery variable: how to convert positive height into negative margin?
    You can convert string to int using parseInt(). Please check a code below : var footerheight = $("#footer").height(); var marginTop = parseInt(footerheight) * -1; $("#footer").css("marginTop", marginTop + "px");

    Categories : Jquery

    Rearrange visual order of 2 divs with floats and negative margin
    I'd suggest taking a look at this tutorial: http://css-tricks.com/resolution-specific-stylesheets/ I feel embarrassed for suggesting that link actually. The appropriate link was css-tricks.com/snippets/css/a-guide-to-flexbox and this is also a decent one weblog.bocoup.com/dive-into-flexbox, both discussing flexbox.

    Categories : CSS

    Handling click events in ViewPager with negative page margin
    I think I solved this myself. I implemented the following method in my PagerAdapter: @Override public void setPrimaryItem(ViewGroup container, int position, Object object) { super.setPrimaryItem(container, position, object); if(object instanceof CardFragment){ CardFragment f = (CardFragment) object; View v = f.getView(); if(v != null){ v.bringToFront(); } } } This helped put the currently selected Fragment in front of the others. But it gets called a lot, also before the Fragments are created, hence the null-check. Not sure if there are any performance-issues with this but it seems to be perfect

    Categories : Android

    Centering div that is wider than its parent without setting negative left margin
    How about using position: absolute; with left:0;right:0; and margin: auto; Also, you'll need to place position: relative; on a parent element which has greater width than the outer element. (In the fiddle below it's relative to the body by default) FIDDLE <div class="outer"> <div class="inner"></div> </div> css .outer { width: 400px; height: 400px; background: beige; margin: 0 auto; } .inner { width: 600px; height: 200px; background: pink; position: absolute; left:0;right:0; margin: auto; }

    Categories : CSS

    CSS positioning: Full-width header shall have the same left margin as the centered content-div
    Why not just place the header outside of the sitecontainer? And then giving it a width of 100%, and a min-width of 1040px. (Or stretch the background image, depending on if it's 1 color, or an image.) Is that what you meant? Maybe post the HTML and the CSS, by the way.

    Categories : CSS

    EM_EXGETSEL does not relate to text selection order. How do I do determine the caret position in a piece of selected text?
    There's no easy way to do this. EM_GETSEL and EM_EXGETSEL return the range of the current selection. Only if there is no selection do they return the position of the caret. Note that the caret can't be in a block of selected text - it is always at the end or beginning. You could probably implement a solution fairly easily by sub-classing the control, and using EM_GETSEL to query and store the position of the caret after any key or mouse input. E.g. LRESULT WINAPI EditControlSubclassProc(...) { LRESULT lRes = CallWindowProc(...); // call original window procedure if ((uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST) || (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)) { DWORD dwStart, dwEnd; SendMessage(hWnd, EM_GETSEL, (WPARAM)&d

    Categories : C++

    Positioning the DIV at correct position
    Change .navigation's position:fixed; to position:inline-block; and add margin-top to make them in line vertically depending on how tall each is Or you could float:left; both of them

    Categories : HTML

    My left position is for some reason not positioning right
    The problem was with the positioning I changed everything to: position: absolute; and added a few other twinks. Take a look at jsfiddle. Is this what you wanted? PS: Next time make sure your jsfiddle works... I had to add height to the divs because the fiddle had it set to 0px thus not displaying anything. EDIT: I changed the styles on the 2nd image to this: #rotsky2 { margin-left: -10px; position: absolute; top: 0; height: 1000px; z-index: -5; left: 0; } Check out the jsfiddle again and if it's not working tell me what browser are you using. :)

    Categories : Javascript

    div Element changes position (margin) of parent div
    Try changing the mainWrapper to: div#mainWrapper { position: relative; text-align: center; margin: 0 auto; /* Added a 0 to the beginning */ width: 70em; height:100%; background: url(../images/header.jpg) no-repeat center center fixed; background-size: cover; padding-left: 4em; } Also add padding: 0; to the body tag.

    Categories : HTML

    FileStream.Position returns a negative value
    Are you trying to store the value in an int variable? FileStream.Position is a long, and casting a value higher than int.Maxvalue to an int could result in a negative value.

    Categories : C#

    Positioning text relative to image position
    Edit: Since you want the text to be overlay you can use a hack using position: relative on the wrapping element and position: absolute on the inner ones. This allows you to position inside the wrapping element as long as the wrapping element has a width and height; http://jsfiddle.net/FcBmd/1/ Irrelavent Text From Previous Answer: Something maybe using text-align: center http://jsfiddle.net/FcBmd/

    Categories : HTML

    How to position canvas using relative/absolute positioning
    Add "px" to your style measurements. E.G top:50; => top:50px; <form id='form1' style="position:relative"> <div id='d1' style="position:absolute; top:0px; left:0px; z-index:1"> <canvas id='canvas1' width='200' height='100'> Your browser does not support HTML5 Canvas. </canvas> </div> <div id='d2' style="position:absolute; top:50px; left:50px; z-index:2"> <canvas id='canvas2' width='100' height='200'> Your browser does not support HTML5 Canvas. </canvas> </div> <div id='d3' style="position:absolute; top:75px; left:75px; z-index:3"> <canvas id='canvas3' width='50' height='50'> Your browser does not support HTML5 Canvas.

    Categories : CSS

    jQuery Draggable Getting Negative Position Value When Dragged
    This question was specific to my problem, but the general problem here is how to properly use containment for jQuery UI Draggable. Solution Since my selector was the same for all the elements I wanted to be draggable they also must have the same containment parameter. If you want to have different containment parameters you must have unique selectors otherwise the first element you call draggable() on will have its containment parameter overridden and this odd behavior will occur.

    Categories : Jquery

    Adjust element position on negative left value
    How are the three divs placed adjacent to each other? If all three divs are floated, you can use a negative margin-left on the middle div rather than a negative left. See: http://jsfiddle.net/Z2rB4/7/

    Categories : HTML

    How to seek negative off the current position in file?
    I'd guess that your problem is that you're not two bytes into the file yet. I just did this with a simple text file: >> fp = File.new('pancakes.txt', 'r') >> fp.readline >> fp.seek(-2, IO::SEEK_CUR) => 0 >> fp.seek(-20, IO::SEEK_CUR) Errno::EINVAL: Invalid argument - x.txt The first line of the file was only a couple characters long so -20 would try to put me before the beginning of the file. I think you just need to throw a pos check into the mix: if file.pos == 0 then you're at the beginning and a negative seek will raise an exception.

    Categories : Ruby

    How to animate Button position (Margin) in Windows Store app?
    You can handle CompositionTarget.Rendering event although you will have to manage all the positioning mathematics yourself which can be difficult in case of many objects - this is only an example and looks a bit strange but works: public MainPage() { this.InitializeComponent(); CompositionTarget.Rendering += OnCompositionTargetRendering; } private void OnCompositionTargetRendering(object sender, object e) { RenderingEventArgs args = e as RenderingEventArgs; double t = (args.RenderingTime.TotalMilliseconds) % 20; button1.Margin = new Thickness(t); }

    Categories : C#

    Negative position:absolute causes horizontal scroll on iPad
    As you don't define overflow:hidden to any parent container, the mobile devices expands the viewport to the size of the content. You you could go with this approach and set the overflow value or you can use position: fixed instead absolute on the slide-out-div. Both should do the trick. Also note the text of the <a>-element with text-indent: -99999px; is "content", but I guess it should be "subscribe".

    Categories : CSS

    Ruby on Rails : Prawn: Positioning table is not working, getting undefined method 'position='
    I just figured it out. The master branch of prawn gem has that fixed. I added gem 'prawn', :git => "https://github.com/prawnpdf/prawn.git", :ref => '8028ca0cd2' instead of gem 'prawn' Now its working and the code matches with the manual they provided

    Categories : Ruby On Rails

    Z-index not behaving as expected with absolute positioning inside a fixed position element
    Move .abs outside of both divs. <div class="fixed first"> <p>This is a fixed element</p> </div> <div class="fixed second"> <p>This is a fixed element</p> </div> <p class="abs"> I should be displayed above both fixed position elements </p> See http://jsfiddle.net/GS4E4/9/ The way you have it now .abs is positioned relative to .first so it will sit above .first but not above .second, your fiddle is interpreting correctly.

    Categories : CSS

    Display image only if it enter in some define position
    You create a container div for your phone and put there a div for the sildes. with overflow:hidden you can hide the additional content. <div id="phone"> <div id="slides"> <img src="pic1.png" /> <img src="pic2.png" /> <img src="pic3.png" /> </div> </div> <input type="button" value="slide up" onclick="slide('up')" /> <input type="button" value="slide down" onclick="slide('down')" /> Check this fiddle: http://jsfiddle.net/qfzBk/2/

    Categories : Javascript

    Adding "fixed position" to my sidebar is positioning elements incorrectly, how can this be fixed?
    It's the inline-block style on your "Subscribe" section. Changing that to display: block fixes the problem for me. See: http://codepen.io/paulroub/pen/cjLim

    Categories : CSS



    © Copyright 2017 w3hello.com Publishing Limited. All rights reserved.