FAQ Database Discussion Community


jQuery bounce effect with border box-sizing and some padding

jquery,css,jquery-ui,padding
If jQuery bounce effect is applied on a div with box-sizing: border-box and some padding, it shrinks by its padding size during effect animation. See here. HTML <div class="test"> This is test div to bounce! </div> CSS .test { box-sizing: border-box; min-height: 100px; width: 250px; background-color: #435ff3; text-align: center; cursor:...

How to add padding/margin to move :after up

css,margin,padding
I am trying to move an :after up, so that it sits more in line with the top of the element it is besides. I've tried adding padding-top and padding-bottom, adding margin-top and margin-bottom, but none of these work. #myDiv:after { color: #D03540; content: " *"; } Any ideas? ...

JButton with padding between its border and the button itself

java,swing,border,jbutton,padding
I've a JButton that has its background green-colored and its border as a LineBorder. I would like to insert a space between the button and the border, a kind of padding. I've tried with setMargin(new Insets(x,y,t,z)) but it seems not working. This is my piece of code. JButton JBtn=new JButton("sdfd");...

How to avoid structure padding?

c,memory-management,structure,padding
I'm curious to know about how #pragma will help to avoid stucture padding (please give me one programme to understand it). By default compilers will allocate memory in an aligned manner. So by avoiding structure padding what will be the benifit programmer will get? When is it neccessary to avoid...

Android Studio | paddingLeft and paddingStart not showing on device

android,android-layout,android-edittext,padding
For some reason the android:paddingLeft and/or android:paddingStart I am using in my layout file is not working when I run it on my device (HTC One M8). I have tried a combination of android:paddingLeft with android:paddingStart, as well as both by themselves. <EditText android:id="@+id/editText_Username" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignBottom="@+id/imageView1" android:layout_alignStart="@+id/imageView1" android:layout_alignLeft="@id/imageView1"...

What is the default height of
elements?

css,css3,padding
I'm working with a web page which currently uses <br> tags for spacing and page layout, and I want to remove all these tags and replace them with an equivalent in CSS to make the page more accessible to screen readers. As part of this process, I need to replace...

CSS style is working in parent stylesheet, but not in child

html,css,twitter-bootstrap,padding
I'm building a website and have run into a CSS issue. I'm using Bootstrap 3, but I also have two additional custom stylesheets. I have an image banner, which I'd like to apply some top padding to in a page that uses both stylesheets (parent linked before child). For some...

Does a float3 in a constant buffer secretly add padding?

c#,directx,padding,hlsl,sharpdx
I have a cbuffer in my shader.fx file, like so: cbuffer lights : register (b1) { float4 Light1Color; float3 Light1Direction; float4 Light2Color; float3 Light2Direction; float4 Light3Color; float3 Light3Direction; } I had some issues filling this cbuffer from my code, it ended up being an array of the following struct: struct...

Padding make item move after adding border on JS click

javascript,html,css,border,padding
I am having a submenu made with an Ul Li. When you display the sub menu, the li are shown without any border. With a simple javascript code, when you click on a li I do this : .actif-link { border: 1px solid rgb(173, 178, 178); padding: 5px; } About...

HTML Margin and padding extrange behaviour

html5,css3,margin,padding
Well, I am working on a webpage. I want a black aside to the left and the content to the right. Here's the simple HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="style/main.css" > <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove...

Trying to remove padding from my h2 titles

html,css,margin,padding
Hi I'm trying to bring my h2 Titles towards the top of the div they're in, but I can't figure out how to remove the padding / margin / whatever it is that is causing them to be spaced down so far. This is the first time I've tried using...

Header moves to the right because of padding

wordpress,header,center,padding
I want my header in Wordpress to center in the body-content. Now the Page-id Div has a padding of 40px both left and right. When adding my Header in the Header.php with a width of 960 + 40 + 40 = 1040, the Header is centered within the body-content, but...

HTML5 & CSS3 responsive website design margin issue

html5,css3,responsive-design,margin,padding
Please take a look here, on my code. I am trying to make a responsive web page, but there is weird margin from top and bottom of first article column. I am talking about margin between top navigation and content column and between footer and content column, and I just...

RelativeLayout programmatically margins not working

android,relativelayout,padding,margins
LinearLayout usersPlaceholder = Main.lay_found_users; //Found Users Placeholder //RelativeLayout Params RelativeLayout userlay = new RelativeLayout(mCtx); //Create new Element userlay.setBackgroundResource(R.drawable.btn_useritem); //Background userlay.setGravity(RelativeLayout.CENTER_HORIZONTAL); //Gravity userlay.setClickable(true); //Clickable RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, dp(80)); relativeParams.setMargins(dp(80), dp(80), dp(80),...

Something like “padding box” to modify DIV, different 100% values of its content?

css,padding,indentation,box
I'm trying to achieve some indent for content inside div. I want to have all elements inside to have 100% width, but first ones have to be positioned further from the left side. This demonstration shows what I exactly need: I tried to mess around with ::before pseudoelement for parent...

Padding doesn't work on some devices

android,android-layout,padding,android-xml
I had a strange problems during the set padding to EditText. xml looks like this: <EditText android:layout_width="270dp" android:layout_height="55dp" android:ems="10" android:id="@+id/etEmail" android:textStyle="bold" android:layout_gravity="center_vertical" android:textColor="#FFFFFF" android:hint="Or Use your Email" android:inputType="textEmailAddress" android:layout_alignLeft="@+id/textView6" android:layout_alignStart="@+id/textView6" android:textColorHint="#FFFFFF" android:background="@drawable/line_white"...

OpenCV - Zero padding of Mat

c++,opencv,padding
Suppose I have a Mat variable small_image with dimensions 98x158x32 (type float). Now I want to zero pad this image (ie. add a border of zeros to the image). I want to add 7 zeros above and below the image, and 12 zeros left and right of the image. The...

Remove padding bottom for height:auto

html,css,padding
I am facing a issue happened to css coding. I really need help in this issue. Cut the story short, i have a div for image and this is the div i wanted for a sliding banners as well. But, i am wondering why there would have a padding below...

Remove left padding of Alert

javafx,alert,javafx-8,padding
Consider this sample program which is adding a TabPane into an Alert. As you will see, there is a white padding on the left of the TabPane that I just cannot remove. If anyone has any idea it will be great. Code: import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Alert;...

Node.js crypto key and iv to match java SecretKeySpec / IvParameterSpec

node.js,encryption,cryptography,aes,padding
I'm trying to to port a Java (simple) encryption algorythm to Node JS. I will need to be able to decrypt/encrypt stuff encrypted/decrypted from the Java side. I'm stuck at the very beginning, the initialization of the cipher. In Java, I get the key with SecretKeySpec, and the Initialization Vector...

Variable padding to justify Elements

html,css,table,padding,justify
I want to create justified elements inside a div. It works, but the space between the elements is different. I want that it looks like in a table. The inside divs need something like variable paddings. I don't know and cannot calculate the width of the elements, so i cannot...

What is the algorithm to calculate some values padding?

file,structure,padding,reverse-engineering
I reversing some game file to translate it and already understand everything, aside of how to determine some blocks padding. For example, I have this in one file (two entries by 36 byte each and then zero padding. 96 bytes total): 01 08 01 80 00 00 00 09 00...

How to pad multiple lists with trailing zeros?

python,arrays,numpy,padding
Suppose I have two lists containing the same number of elements which are lists of integers. For instance: a = [[1, 7, 3, 10, 4], [1, 3, 8], ..., [2, 5, 10, 91, 54, 0]] b = [[5, 4, 23], [1, 2, 0, 4], ..., [5, 15, 11]] For each...

Why won't each color fill its respective box in my menu bar?

html,css,margin,padding
My end goal is when each box is clicked, the background-color is shown. When I added the Javascript for this, it became apparent that the back-ground color didn't actually fill the whole box. This wasn't apparent when there wasn't a color. How do I fix this? http://jsfiddle.net/k7rm33h7/ HTML: <div id="logo">Codeplayer</div>...

Border-box not working, overlay div is including the padding

html,css,padding,border-box
I'm creating a gallery with images having an overlay dark background and caption text. The placement is alright but the overlay div is falling out of the bounds of the image because a padding is used on the container element. I read about it at several places and learned that...

Why structure padding is not happening properly?

c,padding
#include<stdio.h> struct A { char c; double e; int s; }A; int main() { printf("%u\n", sizeof(A)); return 0; } It is giving output 16. Shouldn't it be 24 if we consider structure internal padding and structure padding as a whole? I am compiling the code on Ubuntu 14.04 32 bit...

Where does chrome developer tools show the real calculated width of an element

css,width,margin,padding
I've read somewhere on the internet on the box model and it says that the real width of a block element is not it's width as defined in the CSS but calculated according to the below formula: Real Width = margin-right + border-right + padding-right + width + padding-left +...

ProgressBar and progressBarStyleHorizontal padding

android,layout,progress-bar,padding
I have a progress bar defined thanks to this code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" style="?android:attr/progressBarStyleHorizontal" android:indeterminate="true"...

How to add a simple 8dp header/footer to Android's RecyclerView?

android,margin,padding,recyclerview
Is there a way to add a simple header/footer to a RecyclerView? Here you can see what I've got. The first Card touches the Toolbar And here you can see what I want. 8dp Padding between the bottom and the Card. Methods I tried so far: Use a header view...

Create a text file table with java with padding

java,arrays,table,text-files,padding
Ok since my last text aand question was very vague here is my source as of now and a clearer question. It is all about the padding now. Here is my code up to now: import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; public class makeTable { static...

Which implementations of the C programming language violate the following assumptions?

c,alignment,padding,abi
I'm trying to write a portable function that marshals binary formats into structures according to a formatting string not entirely unlike scanf. To do this, I make a couple of assumptions about the platform my code is running on: This structalign macro portably finds the alignment of a scalar type....

Margin/Padding gap in Kivy UI

python-3.x,margin,padding,kivy
I am using pydev on eclipse luna. My KV file is as follows: <LoginForm>: userid: userid password: password size_hint_x: 0.5 size_hint_y: None height: 200 orientation: 'vertical' pos_hint: {'center_x': 0.5,'center_y':0.5} minimum_height: 100 minimum_width: 100 #User ID Label: text: 'User ID' font_size: 20 size_hint_x: None TextInput: id: userid font_size: 20 #User PW...

How to keep divs from overlapping/moving/making my page look ugly when resizing width and/or height of browser window

html,css,resize,margin,padding
So I'm trying to be able to keep everything where it is even on a a window re size.. an example of what I wish for is similar to face book's registration page (or any page on facebook for that matter... everything gets hidden behind the browser as i minimize...

Padding and Link Issue in HTML/CSS

html,css,image,hyperlink,padding
I am new to HTML and CSS. I have a row of social media icons that link to their respective pages. The HTML for that: <div id="social"> <a target="_blank" href="https://www.facebook.com/"> <img title="Facebook" alt="Facebook" src="img/social/facebook.png" /> </a> <a target="_blank" href="https://twitter.com/"> <img title="Twitter" alt="Twitter" src="img/social/twitter.png" /> </a> <a target="_blank" href="https://instagram.com/"> <img title="Instagram"...

Span-style spacing with full width element

html,css,padding
The title is probably kind of confusing. I have a list of some elements, that each have a CSS hover effect applied (the background lightens). However, I would like each element to fill all of the space in its container, which they currently don't do. Ex: How it should be:...

How to fill in struct paddings in C/C++?

c++,c,struct,padding
Suppose I have the following struct: typedef struct { int mID; struct in_addr mIP; size_t dataSize; // Another structure fairness_structure str; bool ack; bool stability; bool stop_message; }HeaderType; As you know, the size of a struct would vary due to its alignment. How to fill in the padding between fields...

Html - padding - doesnt work as intended

html,padding
probably silly question, but i need your help. I have a div and text inside. I need to adjust text inside div via padding, but when i apply padding command, it do nothing. This is part of my code https://jsfiddle.net/oje_cz/am7twxmp/ <html> <head> <meta charset="UTF-8"> </head> <div id="footer-3" style="height: 80px; float:...

Adding padding to submit buttons on Mac OS X

html,css,input,padding
I'm having trouble adding padding to a submit button. I've created an ultra simple example in a JSFiddle: http://jsfiddle.net/yxr197pa/1/ Here's the code for it: HTML: <input type="submit" value="Submit" /> CSS: input { padding: 20px; } I must just not be getting something really simple, and I'm kind of embarrassed I...

Bootstrap unwanted image padding

html,css,image,twitter-bootstrap,padding
I'm trying to make an image fill up the parent div. I have 4 images, and I want all four of them to appear side by side. Since I'm using Bootstrap, I assigned a col-xs-3 class to all four images. However, I see a small padding around the left and...

How to fix the border and padding on the links

html,css,padding
I'm trying to fix the lines of links on page I'm editing, I can't directly edit the HTML, and can only edit the CSS. For what ever reason no matter what I do, the line of text for a link spills into the other rows. The result should look something...

Understanding memory alignment constraints and padding bytes in C

c,struct,padding,sizeof
I have the following code snippet. #include<stdio.h> int main(){ typedef struct{ int a; int b; int c; char ch1; int d; } str; printf("Size: %d \n",sizeof(str)); return 0; } Which is giving output as follows Size: 20 I know that size of the structure is greater than the summation of...

Padding for placeholder without changing the size of input

css,padding,placeholder,search-form
I do adaptive search form. Search field should take 100% width of the parent div (the width of the parent div will change depending on the resolution of the device). The button "Search" should always be at the right of the field, do not shift down. A working version. But...

Why padding are added, if char comes after int?

c,struct,byte,padding,sizeof
For example, there is a structure struct A { char a; int i; }; In this case, we have a[1 byte] + padding[3 byte] + int[4 byte] = 8. Now let's make little update into struct above, struct A { int i; char a; }; In this case char comes...

Extra padding at the left end of action bar (after updated sdk)

android,android-actionbar,padding
I don't know how this padding came up, but there's no such padding until I updated my SDK to 21. Here's my code: mActionBar = getSupportActionBar(); mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); actionBarView = LayoutInflater.from(this).inflate(R.layout.title_bar_layout, null); mActionBar.setCustomView(actionBarView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); mActionBar.setDisplayShowCustomEnabled(true); Does anyone know how to solve this ? thanks....

What is the use of __packed attribute in function arguments

c,padding,armcc
int readint(__packed int *data) { return *data; } I have seen __packed attribute in struct declarations to avoid padding. However, what is the benefit of using __packed attribute in function arguments. The author says that he has used __packed to tell the compiler that the integer may possibly not be...

How to get padding to show up to the left of the contents?

html,css,user-interface,padding,user-experience
Here is the prototype I am trying to to implement Here is what I have so far - JFiddle The highlighted part is what I am currently working on. I am trying to get some space between the paragraph contents and the components to the left of it(Profile 6, Profile...

Pad only in one direction with tkinter? [duplicate]

python-3.x,tkinter,padding
This question already has an answer here: Adding padding to a tkinter widget only on one side 1 answer Is it possible to pad a widget only from the top and not the bottom? The pady command will always add pixels both ways... :\ Here's an example: from tkinter...

Bringing text down into the center with css

html,css,padding
Hello I am needing some help with my website. As you can tell from the image I have provided I need the text to be centered in the middle of the rectangular box. How do I go about doing this? My css is, .extendcontainer { background: rgba(255,255,255,0.1); // Transparent White...

How to declare structures in C to avoid structure corruption?

c,struct,padding,packing
I have a similar problem like this question and my problem was solved similar to this answer but I can't understand what caused this issue. I have three structures File, Line and Buffer declared in app.h. typedef struct File { FILE *fs; char *path; size_t size; } File; typedef struct...

Why does the box come out like this (padding/border/margin)?

html5,css3,border,margin,padding
So this is my first day learning HTML&CSS and I'm currently having a problem. Why does this block come out like this (on left is what I get & on right is what I'm trying to achieve): HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Temporary</title> <link rel="stylesheet" href="main2.css"> </head>...

Padding top as percentage of width not working

css,padding,percentage
Here is my example code: body { margin: 0; padding: 0; border: 0; background: #444; } #container { width: 25px; margin: auto; margin-top: 2px; padding-top: 1%; border-bottom: 3px solid #58e; background: #fff; } <div id="#container">text</div> When I run it in chrome and inspect element the computed style of the div,...