Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2014
    Location
    England
    Posts
    14
    Plugin Contributions
    0

    Default Changing CSS Style For attribute drop down

    Hi,

    I am really new to ZenCart and PHP, php really confuses me as Im used to html so sorry about the noob question.

    I am trying to change the css on the choice menu, for flavour. All's i want to do is put padding on it, but not effect any other parts of the website that use SELECT.

    PHP Code:
    <div class="wrapperAttribsOptions">
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    <div class="back">[B]<?php echo "\n" $options_menu[$i]; ?>[/B]</div>
    The above in bold is the part of the css style I am trying to change.

    This converts to

    HTML Code:
    <div class="wrapperAttribsOptions">
    <h4 class="optionName back"><label class="attribsSelect" for="attrib-1">Flavour</label></h4>
    <div class="back">
    <select name="id[1]" id="attrib-1">
      <option value="4">Banana</option>
      <option value="3">Choc Cookie</option>
      <option value="2">Strawberry</option>
    </select>

    I cant seem to locate the select name="id[1]" id="attrib-1" bit, so I can edit it and put my own CSS style into it, can anyone tell me where it will be?

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Changing CSS Style For attribute drop down

    A link to your site will help us help you.

  3. #3
    Join Date
    Jan 2014
    Location
    Ontario, Canada
    Posts
    252
    Plugin Contributions
    3

    Default Re: Changing CSS Style For attribute drop down

    Make a new class for the item you want (h4 class="optionName back") to add your css to, then add it to your stylesheet.

    includes/templates/YOUR_TEMPLATE/css/stylesheet.css

    for example:
    .choiceMenu { padding: 1em;} instead of h4 class

    Hope that helps,

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,973
    Plugin Contributions
    96

    Default Re: Changing CSS Style For attribute drop down

    Quote Originally Posted by Dan1234 View Post
    Hi,

    I am really new to ZenCart and PHP, php really confuses me as Im used to html so sorry about the noob question.

    I am trying to change the css on the choice menu, for flavour. All's i want to do is put padding on it, but not effect any other parts of the website that use SELECT.

    PHP Code:
    <div class="wrapperAttribsOptions">
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    <div class="back">[B]<?php echo "\n" $options_menu[$i]; ?>[/B]</div>
    The above in bold is the part of the css style I am trying to change.

    This converts to

    HTML Code:
    <div class="wrapperAttribsOptions">
    <h4 class="optionName back"><label class="attribsSelect" for="attrib-1">Flavour</label></h4>
    <div class="back">
    <select name="id[1]" id="attrib-1">
      <option value="4">Banana</option>
      <option value="3">Choc Cookie</option>
      <option value="2">Strawberry</option>
    </select>

    I cant seem to locate the select name="id[1]" id="attrib-1" bit, so I can edit it and put my own CSS style into it, can anyone tell me where it will be?
    Quote Originally Posted by stevesh View Post
    A link to your site will help us help you.
    As stevesh indicated, a link to your site would really help, but in answer to your last question, you can add some padding to that specific <select> statement by adding something similar to the following to the bottom of your /includes/templates/YOUR_TEMPLATE/css/stylesheet.css file:
    Code:
    #attrib-1 { padding: 5px; }
    Since the Flavour attribute is option ID#1, it will always appear with id="attrib-1". Within the CSS, you identify that you want to apply a style to an id using the # character, so that bit of CSS indicates that wherever in the HTML there is an id="attrib-1" that the specified style is to apply.

  5. #5
    Join Date
    Feb 2014
    Location
    England
    Posts
    14
    Plugin Contributions
    0

    Default Re: Changing CSS Style For attribute drop down

    Really appreciate the replys guys, was really helpful, got it done now!

 

 

Similar Threads

  1. v151 How to uninstall CSS Horizontal Drop Down Menu (CSS Flyout Header 1.5)
    By cmike in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Feb 2014, 07:39 AM
  2. Changing text style using CSS to override the H1 style
    By NBordeau in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 May 2010, 02:19 PM
  3. css drop down menu by Pierre for ver. 1.3.7
    By pazdar in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 May 2010, 10:29 PM
  4. Using a drop down for single attribute products
    By alwaysriding in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 Dec 2009, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg