I have been working on this problem for days now and I just can't seem to find the answer.
I am using Drupal 7 and I am trying to use E-junkie's shopping cart in one of my blocks on the frontpage. The pop-up overlay and etc. are fine but apparently my Drupal theme's CSS Styles is overwriting that of my shopping so it comes out wrong.
This is the website that I am working on: http://eastwestcards.com - Under the big View Cart button there is an Add to Cart button that you can use to add a free product for the sake of being able to see what I mean by the shopping cart coming out all wrong. My checkout button is all the way to the left and if you click an empty space at the bottom it actually sends you to checkout, the item lists and the rest of the tables have no borders or cell spacing/padding and a few other things.
Now this site on the other hand is how my shopping cart should like: http://pixilate.com/fonts/gardenia-px - Just click Add to Cart for the product and you will see the different between my cart and that sites'.
I have been looking for help all over and I've tried everything that has been suggested to me, I have tried exempting the cart's design from my CSS stylesheet, I have tried overwriting my drupal theme's CSS and etc, I've even tried using the View Source Chart plugin for firefox to try and determine which tags and etc. I should be trying to fix in order to change the appearance of the shopping cart on the site. I used the View Source Chart plugin because viewing my page's source normally doesn't show the HTML code for the shopping cart pop up because it is a javascript code that is provided by e-junkie that I simply put on my site. I am fairly new to all of this but I have really tried my best to fix this problem and I hope someone will be kind enough to help me! Thank you in advance!
I made this change "border-collapse: separate" and "border-spacing: 2px" and i also added this stuff at the end of my css stylesheet, some of it works, some of it doesn't but it seems to look okay now:
#EJEJC_window table {
background-color: white;
!important;
}
div#EJEJC_iframeContent td
#EJEJC_iframeContent div {
border-width: 3px;
border-spacing: 20px;
border-style: solid;
border-color: green;
border-collapse: collapse;
background-color: white;
!important;
}
#EJEJC_iframeContent th {
border-width: 3px;
border-spacing: 20px;
border-style: solid;
border-color: green;
border-collapse: collapse;
background-color: white;
!important;
}
#ejejctable table {
font-family: arial;
font-size: 12pt;
background-color: white;
border-style: solid;
border-color: white;
padding: 4 px;
!important;
}
#ejejctable th {
border-width: 4px;
border-style: solid;
border-color: white;
padding: 4px;
!important;
}
#ejejctable td {
border-width: 4px;
border-style: solid;
border-color: white;
padding: 4px;
!important;
}
#ejejctable tr {
border-width: 4px;
border-style: solid;
border-color: white;
padding: 4px;
!important;
}
#ejejctable tbody {
border-width: 4px;
border-style: solid;
border-color: white;
padding: 4px;
!important;
}
#tdHeader { padding: 25px; !important; }
td#tdPmntOptions tr { float:right; !imporant; }
#tdPmntOptions tr { float:right; !imporant; }
img#btnEJ { float:right; !imporant; }
#btnEJ { float:right; !imporant; }
If you look at this screenshot, you'll see what the problem is. The blue area is your link tag, and the checkout button is actually just an image that's rattling around in all that empty space. Clicking the white area takes you to checkout because as far as the computer's concerned, you are, in fact, clicking the on the link tag (just not on the image that a human user would expect to click on).
The quick and easy solution is to just give that link tag "float:right". Apart from positioning elements, the float property also makes containers "shrink wrap" around their contents. In this case, your link tag will shrink down to the size of the button image.
You could also give the link tag a fixed width and height, but the float solution is more flexible.
Hope that helps!
EDIT: Just spotted that element.style.css is setting a tags to "display: block". There's your problem. Change that to "display: inline" and it should behave normally.
As for the line spacing on the table, style.css is setting border-collapse to collapse and setting border-spacing to 0. Changing those to "border-collapse: separate" and "border-spacing: 2px" should fix it.
Related
When I use the following CSS, I go from the output of the image at the top to the image at the bottom:
.menu-border {
border: 1px solid #000000;
padding: 30px 0px;
border-radius: 4px;
}
The purpose is to have a larger hover area for the mega menu, otherwise the mega menu disappears when the mouse is between the ''Assessment'' menu and the mega menu box. However, when my padding is at 30px, all the menu items shift higher up. What would I need to add to keep this large box (the edges will be white - I put black so it is easier to see now) without affecting the rest of the menu?
edit1: the menu is generated from the pearl theme for wordpress. The .menu-border is an added css class for the ''assessment'' menu.
If we could get a working snippet it would be easier to help.
Also, there are two menus in your capture. I guess that adding the code it's the second one. Looks you're missing vertical-align property
.menu-border {
border: 1px solid #000000;
padding: 30px 0px;
border-radius: 4px;
vertical-align: middle;
}
I'm unsure what you're exactly looking for but have a crack at this CSS that's using the inline-block property -
.menu-border {
display: inline-block;
border: 1px solid #000000;
padding: 30px 0px;
border-radius: 4px;
}
Further reading on CSS inline-block
https://www.w3schools.com/css/css_inline-block.asp
If someone ever face that problem, the solution was to replace my code with this
body .stm-header .stm-navigation__default > ul > li > a {
padding: 30px 30px;
}
There is a very strange problem in my website. When opening the homepage on Mozilla the borders of the 2 buttons on my header are missing. You can check the website here: http://www.beautiful-burger.com
Just open it on mozilla and refresh it multiple times to see what I am talking about. The buttons are the ones used on the top right BUT they are also used on the lower part of the homepage (without any problems on the borders). Also, if you check another page, like the Food Blog, you will see that they appear just fine there. Is it a problem with the header? I have been trying to figure this out for the past 2 days but I have no clue what's going on..It runs just fine on other browsers. The css I am using atm is this:
#header-button-container .primary-button,
#header-button-container .secondary-button {
color: #ffffff ;
border: 1px solid #ffffff !important;
vertical-align: baseline;}
.secondary-button {
background-color: transparent ;
border: 1px solid #ffffff !important;
color: #fff !important;}
.secondary-button:hover{
background-color: #D0C274 !important ;
color: #fff ;}
.site-header .secondary-button {
color: #fff; }
Thank you for your time and any help. Feel free to ask if you need any more information since I am very new at this and probably missing something out.
I can't replicate the problem in my firefox. What version and what OS?
In your css your only targeting the border attributes using 'border:' rather than specifying individually. Use something like the following.
#header-button-container-inner .button.secondary-button {
border-color: white;
border-style: solid;
border-width: 1px;
}
if that doesn't work
#header-button-container-inner .button.secondary-button {
border-color: white !important;
border-style: solid !important;
border-width: 1px !important;
}
And if that doesn't work
#-moz-document url-prefix() {
#header-button-container-inner .button.secondary-button {
border-color: white !important;
border-style: solid !important;
border-width: 1px !important;
}
}
I'm working on my school newspaper's wordpress website, and I'm trying to indent the content of the rotating tweets widget by 15px. I've tried adding the following code to the wordpress theme editor's style.css sheet, but it hasn't made any noticeable changes:
.rotatingtweet{padding-left: 15px;}
When I add the same line of code in google Chrome in developer mode, it has the desired effect, but I just can't get it to work by editing the website's main style.css file in the "Voice" wordpress theme.
Thanks for your time!
-John
The tweets are displayed with position: absolute within their container, so they ignore the padding.
Put the padding on the outer div instead, then adjust the header:
.widget_rotatingtweets_widget {
padding-left: 15px;
}
.widget_rotatingtweets_widget h4 {
margin-left: -15px;
}
EDIT: The above, with additional tweaks to borders and such, will work, but there may be a slightly easier solution.
Instead of using padding, give the rotating tweets container a left margin. In your style.css file (probably line 102), there is a selector:
#content .rotatingtweets,
#content .norotatingtweets {
border-top: 1px solid #DDD;
border-bottom: 1px solid #DDD;
margin-bottom: 3%;
}
If you change this to:
#content .rotatingtweets,
#content .norotatingtweets {
margin-bottom: 3%;
margin-left: 15px;
}
and move the borders to the elements just before and after the rotatingtweets container:
.sidebar .widget_rotating_tweets .widget_title {
border-bottom: 1px solid #DDD;
}
.widget_rotating_tweets .follow-button {
border-top: 1px solid #DDD;
}
This seems to accomplish what you want.
I'm working on something in my free time, a little selection tool for a game I play, Dota2.
I've poured the entire HTML output of the current situation in to a fiddle: http://jsfiddle.net/a8T6L/
This has a list of checkboxes and a list of items. These are figures, all set to display: table. The idea is that when I click one or more checkboxes, only items possessing the selected attributes will remain shown. That functionality isn't complete yet, so if you click a checkbox, everything will disappear. Simply uncheck everything to make it appear again.
Each item is a <figure> with and <img> and <figcaption>. Locally I'm generating the entire set with some PHP, I just copied the HTML/CSS/JavaScript so I could make the fiddle.
I was trying to add a border when you hover over an item, but this is shifting the items in some cases.
The relevant CSS code can be found on the fiddle at line 438:
figure {
text-align: center;
display: table;
width: 120px;
height: 90px;
padding: 15px auto; /* not needed unless you want centered */
margin-top: 5px;
}
figure:hover {
cursor: hand;
cursor: pointer;/*Should be good with all browsers*/
border-style: inset;
border-color: #000;
border-width: 1px;
}
I've tried playing with margins and padding(some of that left in the code), even with border-collapse, but nothing seems to work. What I'm trying to achieve here is that when I hover over the figure, an inset appears to let the user know which item is highlighted without anything moving even a pixel. Just the inset appearing.
I realize I could do this with background-color instead, if my intent is simply to let the user know which item is being hovered over, but then I wouldn't know the answer to this problem.
The reason this is happening is because it's adding pixels around the image when you hover. You should set your initial class with a border: 1px solid transparent; so that when you hover you aren't adding pixels but just changing the border color.
figure {
text-align: center;
display: table;
width: 120px;
height: 90px;
padding: 15px auto; /* not needed unless you want centered */
margin-top: 5px;
border: 1px solid transparent;
}
figure:hover {
cursor: hand;
cursor: pointer;/*Should be good with all browsers*/
border-color: #000;
}
Mathew is spot on with the reason (+1) another approach is to use outline instead of border:
figure:hover {
cursor: hand;
cursor: pointer;/*Should be good with all browsers*/
outline-style: inset;
outline-color: #000;
outline-width: 1px;
}
This should have the added benefit of working on browsers that don't support transparent for borders (i.e. IE6) if you are bothering to support such dodery old things. The down side is that the outline will caculate outside of the element, so if you run these elements up against the side of the page you may loose part of your border.
At the moment, I'm building my own Wordpress Theme. Amongst others I have a problem with the widgets... i want them to have a border (CSS) but it wont work. I tried everything, from different paddings to different margins. I mean its just a border... can it really be that hard?!
URL: http://www.biggaa.de
Search for this section in your CSS
#sidebar li {
list-style-type: none;
margin-top: 5px;
margin-bottom: 5px;
text-align: left;
border: 1px #CCC;
background: black;
}
You need to change the line that says
border: 1px #CCC;
to
border: 1px solid #CCC;
Also, change to color to whatever you desire. Your widgets also use the CSS class "widget" so you could try doing this as well:
.widget {
border: 1px solid white;
}
I would recommend using Chrome's Developer Tools, or Firebug for Firefox, and inspect the element of the page (right-click then inspect element). This will allow you to focus in on areas of your website you want to change, without having to dig through all the CSS. Good luck!