Solved

HTML, CSS, Change content on mobile

Posted on 2013-06-02
2
183 Views
Last Modified: 2013-09-16
Hi,

I have the below code, what I want to do is change the size of the Title which is The S R and remove the logo if someone is using a mobile device, please help how can I do this

     <div class="row" style="border-left: 1px solid black; border-right: 1px solid black;
            background-color: Black; font-family: Georgia,'Times New Roman',Times,serif;">
            <div class="large-12 columns" style="color: White; font-weight: bold; font-size: 65px;
                padding-top: 10px; padding-bottom: 10px; padding-left: 10px; ">
                <img src="images/Email.gif" alt="Logo" style="padding-right: 25px;" />
                The S R
            </div>
        </div>

Open in new window


If this mean creating another CSS file thats fine as well I need to know how to detect the mobile device and use the CSS accordingly

Thanks

R8VI
0
Comment
Question by:R8VI
2 Comments
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39214311
Try this...

HTML
     <div class="row" style="border-left: 1px solid black; border-right: 1px solid black;
            background-color: Black; font-family: Georgia,'Times New Roman',Times,serif;">
            <div id="header" class="large-12 columns" style="color: White; font-weight: bold; font-size: 65px;
                padding-top: 10px; padding-bottom: 10px; padding-left: 10px; ">
                <img src="images/Email.gif" alt="Logo" style="padding-right: 25px;" />
                The S R
            </div>
        </div>

Open in new window




CSS:
@media only screen and (max-width: 500px){
   #header img{
         display:none;
    }
    #header{
          font-size: 40px !important; // Change it acc. to you... 
     }
}

Open in new window



This is done with media queries... See here... a good tutorial on it...
http://mobile.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39214319
detecting the device is not reliable, and can cause more problems than it solves.  What you need to do is detect the device characteristic and present alternate CSS using media queries

Cd&
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question