0

I am trying to use

https://bootswatch.com/slate/

I have file upload jsp, I think the functionality works but view/visually it is not working.

<html>

<Head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>

  <link href="https://bootswatch.com/slate/bootstrap.min.css" rel="stylesheet" type="text/css" />
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <form id="testf" method="post" enctype="multipart/form-data" action="x.do">
    <div class="col-md-8">
      <label>Browse
        <div class="text-warning">
          <input id="uploadfile" name="uploadfile" type="file" accept=".csv">
          <div>
      </label>
      </div>
  </form>
</body>
</html>

In slate theme, I don’t see the text “No File Chosen”. and after selection I don't see text with "selected file name"

with exact same code, and vanilla bootstrap I can see those texts... can anyone help me understand how can I get that working in slate theme? as specially after the file is selected I need to show the name..

Sendi_t
  • 617
  • 5
  • 13
  • Just change the color: `input[type=file] { color: white; }`. Also, your markup is not valid HTML, validate it. – vanburen Jan 11 '17 at 01:08
  • Thank you.. I thought that
    would work.. but it didn't.. i will fix the validation.. do you want to create an answer ? I will accept it
    – Sendi_t Jan 11 '17 at 01:15

1 Answers1

0

You just need to change the text color since the bootstrap default is rgb(51, 51, 51) and the Slate theme is using a dark color for it's body background (#272b30 / rgb(39, 43, 48)).

CSS Example:

input[type=file] { color: white; }

Working Example:

input[type=file] {
  color: white;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://bootswatch.com/slate/bootstrap.min.css" rel="stylesheet" />

<form id="testf" method="post" enctype="multipart/form-data" action="x.do">
  <div class="col-md-8">
    <label>Browse
      <input id="uploadfile" name="uploadfile" type="file" accept=".csv">
    </label>
  </div>
</form>
vanburen
  • 21,502
  • 7
  • 28
  • 41