use .css({ width: "100%", padding: "0".....}) instead of attr.