CSS未在IE11和Chrome中加载

时间:2015-11-07 12:55:59

标签: html css css3

我的html页面中使用的CSS是

<style type="text/css"> 
body {background-color:#FFFFFF;font-family:Calibri;} 
table{margin-left:auto;margin-right:auto;border:1px solid RoyalBlue;border-         collapse:collapse;font-size:90%;} 
td{margin:0px;border:1px solid RoyalBlue;padding:1px;} 
td.tcname_selected {{margin:0px;align:center;background-     color:LightSkyBlue;min-width:900px;color:white;font-weight:bold;} 
td.tcname {{margin:0px;align:center;background-color:LightSkyBlue;min- width:900px;} 
td.tccontainer {padding:0px;} 
tr.stepstbl_vis {} 
tr.stepstbl_notvis {display:none;padding:1px;border:0px;} 
<!-- table.stepstbl {margin:0px;border:none;padding:1px;} --> 
table.stepstbl {border:1px solid RoyalBlue;border-collapse:collapse;font- size:90%;} 
td.step_head {{margin:0px;align:center;background-  color:LightSkyBlue;border:1px solid RoyalBlue;padding:1px;} 
td.step_reg {{margin:0px;border:1px solid RoyalBlue;padding:1px} 
span.hidden {display:none;} 
</style> 

CSS is not loading when i use it in my code -
<body> 
<table width="90%" align="center"> 
<tr> 
<td width="97%" class="tcname" id="tsname1"> 
</td> 
</td> 
</tr>

当我在IE8浏览器中使用它时,相同的代码工作正常。表格正在创建,但它没有显示表格单元格的背景颜色为蓝色,因为CSS未在IE11和Chrome中加载。可以帮我一些找出根本原因?

1 个答案:

答案 0 :(得分:0)

我快速修复了你的代码,不知道你真正想要的是什么,但应该有效

package com.thesis.juandirection.juandirectionfinale.fragments;

/**
 * Created by Galvez on 11/5/2015.
 */

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ProgressBar;
import java.util.ArrayList;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener;
import com.nostra13.universalimageloader.core.listener.SimpleImageLoadingListener;
import com.thesis.juandirection.juandirectionfinale.Holder.GlobalVar;
import com.thesis.juandirection.juandirectionfinale.R;
import com.thesis.juandirection.juandirectionfinale.Constants;
public class ImageGridFragment extends AbsListViewBaseFragment {

    public static final int INDEX = 1;


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fr_image_grid, container, false);


        listView = (GridView) rootView.findViewById(R.id.grid);
        ((GridView) listView).setAdapter(new ImageAdapter(getActivity()));
        listView.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                startImagePagerActivity(position);
            }
        });
        return rootView;
    }

    private static class ImageAdapter extends BaseAdapter {
        ArrayList<String> IMAGE_URLS = new ArrayList<>();
        private LayoutInflater inflater;
        private DisplayImageOptions options;
        ImageAdapter(Context context) {
            inflater = LayoutInflater.from(context);
            options = new DisplayImageOptions.Builder()
                    .showImageOnLoading(R.drawable.abc_ab_share_pack_mtrl_alpha)
                    //.showImageForEmptyUri(R.drawable.abc_ab_share_pack_mtrl_alpha)
                    //.showImageOnFail(R.drawable.abc_ab_share_pack_mtrl_alpha)
                    .cacheInMemory(true)
                    .cacheOnDisk(true)
                    .considerExifParams(true)
                    .bitmapConfig(Bitmap.Config.RGB_565)
                    .build();
        }

        @Override
        public int getCount() {
            return Constants.IMAGES.size();
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            IMAGE_URLS = (ArrayList<String>) Constants.IMAGES.clone();
            final ViewHolder holder;
            View view = convertView;
            if (view == null) {
                view = inflater.inflate(R.layout.item_grid_image, parent, false);
                holder = new ViewHolder();

                assert view != null;
                holder.imageView = (ImageView) view.findViewById(R.id.image);
                holder.imageView.setId(position);
                holder.checkBox = (CheckBox) view.findViewById(R.id.cbImage);

                holder.progressBar = (ProgressBar) view.findViewById(R.id.progress);
                view.setTag(holder);

                if (GlobalVar.getPosition.size() > 0) {
                    Constants.IMAGES_SELECTED.clear();
                     for (int x = 0; x < GlobalVar.getPosition.size(); x++) {
                        if (position == GlobalVar.getPosition.get(x)) {
                            holder.checkBox.setChecked(true);
                       }
                    }
                }

             holder.imageView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if (!holder.checkBox.isChecked()) {
                            holder.checkBox.setChecked(true);
                            GlobalVar.getPosition.add(position);
                        } else {
                            GlobalVar.getPosition.remove(GlobalVar.getPosition.indexOf(position));
                            holder.checkBox.setChecked(false);
                        }
                    }
                });
            } else {
                holder = (ViewHolder) view.getTag();
            }

            ImageLoader.getInstance()
                    .displayImage(IMAGE_URLS.get(position), holder.imageView, options, new SimpleImageLoadingListener() {
                        @Override
                        public void onLoadingStarted(String imageUri, View view) {
                            holder.progressBar.setProgress(0);
                            holder.progressBar.setVisibility(View.VISIBLE);
                        }

                        @Override
                        public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
                            holder.progressBar.setVisibility(View.GONE);
                        }

                        @Override
                        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                            holder.progressBar.setVisibility(View.GONE);
                        }
                    }, new ImageLoadingProgressListener() {
                        @Override
                        public void onProgressUpdate(String imageUri, View view, int current, int total) {
                            holder.progressBar.setProgress(Math.round(100.0f * current / total));
                        }
                    });

            return view;
        }
    }

    static class ViewHolder {
        ImageView imageView;
        CheckBox checkBox;
        ProgressBar progressBar;
    }
}