小编jon*_*baa的帖子

使用Google Maps元素定义div(CSS)的百分比高度

我正在尝试为我的网站创建一个"联系人"部分,我在左侧有文本,右侧有Google地图元素以显示我们的位置.目前我已经设法让div彼此相邻,但问题是我似乎无法获得地图的高度以匹配旁边的div.我看过其他问题和例子,最流行的答案似乎是"添加一个包装并将其高度和宽度定义为100%,然后将div的高度定义为100%",但这并不适用于我.我不想为地图定义固定的px高度,因为它不会以响应的方式适应窗口的宽度.

目前我有:

HTML

<!-- CONTACT SECTION -->
  <div class="third" id="contacts">

    <div class="starter-template">
      <h2>Contact Us</h2><br>
      <div class="basic-container">
        <div class="contact">
          <p class="lead">Location</p>
          <p>The student team spaces can be found at Urban Mill, located between Startup Sauna and Aalto Design Factory at the Aalto University campus in Otaniemi, Espoo (Street Address: Betonimiehenkuja 3, Espoo, Finland). Most of the lectures will also be held at Urban Mill. The accommodation of the students is at Forenom Hostel (Street Address: Kivimiehentie 2, Espoo), which is only …
Run Code Online (Sandbox Code Playgroud)

html css height google-maps percentage

5
推荐指数
0
解决办法
399
查看次数

材质UI:无法更改主题中的按钮文本颜色

我在Material UI主题中直接更改按钮文本颜色时遇到问题.更改原色+按钮字体大小工作正常,所以问题不在于传递主题.这是我的代码:

import React from 'react';
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
import { lightBlue } from 'material-ui/colors';
import styled from 'styled-components';

const theme = createMuiTheme({
  palette: {
    primary: lightBlue, // works
  },
  raisedButton: {
    color: '#ffffff', // doesn't work
  },
  typography: {
    button: {
      fontSize: 20, // works
      color: '#ffffff' // doesn't work
    }
  }
});

const App = ({ user, pathname, onToggleDrawer }) => (
  <MuiThemeProvider theme={theme}>
    ...
  </MuiThemeProvider>
);
Run Code Online (Sandbox Code Playgroud)

我也尝试使用导入的颜色而不是#ffffff,但这也没有效果.

有人有任何想法吗?

themes colors button material-ui

0
推荐指数
3
解决办法
9169
查看次数

标签 统计

button ×1

colors ×1

css ×1

google-maps ×1

height ×1

html ×1

material-ui ×1

percentage ×1

themes ×1