asked    Edwiin     2018-10-22       html       54 view        3 Answers

[SOLVED] Using CSS or HTML how can I eliminate the margins of a website?

I am building the project section of my personal website.

It looks the following way:

Website

I am trying to get rid of the left margin so my image can start from the left margin.

This my current code:

    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
  <div class="row-lg-4">
    <div class="hovereffect">
        <img class="img-responsive" src="../Projects/img/cyberSecurity.jpg" height = "600vh" width = "100vw" alt="">
            <div class="overlay">
                <h2>Effect 12</h2>
        <p>
          <a href="">LINK HERE</a>
        </p>
            </div>
    </div>
</div>
</div>

I have tried doing inline CSS

<body style="margin:0; padding:0;">

It does not work.

I have also tried doing:

* {
margin: 0;
padding: 0;

}

in my css file. However, that did not work either.

Any sort of help would be highly appreciate it :D

Have a wonderful day.

  3 Answers  

        answered    Arno     2018-10-22      

To remove padding/margin in bootstrap, do something like this.

Add no-padding class to padding: 0px; for bootstrap columns and no-marginLR class to margin-left:0; and margin-right:0; for bootstrap rows.

here, no-padding and no-marginLR are used as example purpose.

<div class="container">
<div class="row no-marginLR">
    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 no-padding">
      ...your code
    </div>
</div>


        answered    Uriah     2018-10-22      

If you want multiple columns that go edge to edge you could just use .no-gutters on the .row and make sure it's not nested in a .container.

<div class="row no-gutters">
    <div class="col-12 col-sm-6 col-md-8">.col-12 .col-sm-6 .col-md-8</div>
    <div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>


        answered    Marshall     2018-10-22      

There are some stuff that you should fix in order to get this done without any kind of "force".

You need to wrap the all this in one row div (div class="row"), since a column must be inside a row like this:

<div class="row">
    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
         <div class="row-lg-4>
            <div class="hovereffect">
                 <img class="img-responsive" src="../Projects/img/cyberSecurity.jpg" height = "600vh" width = "100vw" alt="">
                 <div class="overlay">
                    <h2>Effect 12</h2>
                    <p>
                     <a href="">LINK HERE</a>
                    </p>
                 </div>
            </div>
        </div>
    </div>  
</div>

Make sure that " <div class="hovereffect">" doesnt have any kind of spacing property added in the CSS File.

This line by default would have a padding of 15px, so you can get rid of this padding by adding the class "px-0". (if it is inside of a row, you dont need to do this).

  <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">

As a final resource if any of these worked for you (they should work since thats how the grid system works), you can created your own not padding class that would look like this:

.nospacing {
   padding: 0 !important;
   margin: 0 !important;
}

Then you can add it to any of your HTML Tags.





Your Answer





 2018-10-22         Winifred

How can I get golang mysql driver to timeout pings in 2 seconds?

I am having some trouble figuring out how to make a database connection-attempt timeout properly in Go. I am using some of the examples at this excellent resource as a base. I believe I am setting up everything correctly, but my pings just refuse to time out after 2 seconds. I've extracted the code in question into a sample program as follows. Note that there is no database running at 172.1.2.3.package mainimport ( "context" "database/sql" _ "github.com/go-sql-driver/mysql" //MySQL driver "log" "time")func main() { log.Print("Trying to ping database!")...
 mysql                     1 answers                     35 view
 2018-10-22         Kelly

Android app failed to connect to local server over WIFI

I'm developing an Android app that must connect to the server to retrieve some data. I've 2 devices connected on my local WIFI via a router: My development laptop (as server) and my development android phone (as client). The laptop has as IP address 192.168.41.50 and my Apache HTTP server is running on port 81.My problem is the following:If I run my android application to retrieve data into the server, it doesn't work, it's giving me a timeout exception: D/OkHttp: <-- HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.43.50 (port 81) after 12000...
 android                     2 answers                     33 view
 2018-10-22         Dylan

Change the timespan millisecond separator; comma(,) instead of dot(.)

This question already has an answer here: How to format the HH:mm:ss separators of a TimeSpan in a culture-aware manner? 3 answers Use the "g"-format specifier, so t.ToString("g", culture). By default a TimeSpan is converted using the "c"-format specifier, which is a common non-culture specific format.Using string.Format this would beString.Format(cul, "{0:g}", t)More info on formatting timespans can be found in the docs [XXX]This works for me. Version fiddleTimeSpan t = new TimeSpan...
 c#                     2 answers                     33 view